mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
fix desktop login
This commit is contained in:
parent
cebb4dd580
commit
0ca53b7e63
2 changed files with 8 additions and 27 deletions
|
@ -1066,5 +1066,10 @@
|
||||||
"Channel profile picture": "Channel profile picture",
|
"Channel profile picture": "Channel profile picture",
|
||||||
"(%count%)": "(%count%)",
|
"(%count%)": "(%count%)",
|
||||||
"Reposts of %uri%": "Reposts of %uri%",
|
"Reposts of %uri%": "Reposts of %uri%",
|
||||||
"A backup of your wallet is synced with lbry.tv.": "A backup of your wallet is synced with lbry.tv."
|
"A backup of your wallet is synced with lbry.tv.": "A backup of your wallet is synced with lbry.tv.",
|
||||||
|
"Tag Selection": "Tag Selection",
|
||||||
|
"Select some tags to help us show you interesting things.": "Select some tags to help us show you interesting things.",
|
||||||
|
"You are currently following %followingCount% tags": "You are currently following %followingCount% tags",
|
||||||
|
"Back": "Back",
|
||||||
|
"Nice! You are currently following %followingCount% creators": "Nice! You are currently following %followingCount% creators"
|
||||||
}
|
}
|
28
ui/index.jsx
28
ui/index.jsx
|
@ -132,39 +132,15 @@ Lbryio.setOverride(
|
||||||
'getAuthToken',
|
'getAuthToken',
|
||||||
() =>
|
() =>
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
// @if TARGET='app'
|
|
||||||
const desktopAuthTokenToReturn = authToken || getAuthToken();
|
|
||||||
|
|
||||||
if (desktopAuthTokenToReturn) {
|
|
||||||
resolve(desktopAuthTokenToReturn);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Old users who haven't moved to storing the auth_token in a cookie
|
|
||||||
// Get it => set it => delete from keychain
|
|
||||||
ipcRenderer.once('auth-token-response', (event, keychainToken) => {
|
|
||||||
if (keychainToken) {
|
|
||||||
Lbryio.authToken = keychainToken;
|
|
||||||
setAuthToken(keychainToken);
|
|
||||||
resolve(keychainToken);
|
|
||||||
ipcRenderer.send('delete-auth-token');
|
|
||||||
} else {
|
|
||||||
// No auth_token saved anywhere
|
|
||||||
resolve('');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcRenderer.send('get-auth-token');
|
|
||||||
// @endif
|
|
||||||
|
|
||||||
// @if TARGET='web'
|
|
||||||
const authTokenToReturn = authToken || getAuthToken();
|
const authTokenToReturn = authToken || getAuthToken();
|
||||||
|
|
||||||
|
// @if TARGET='web'
|
||||||
if (authTokenToReturn !== null) {
|
if (authTokenToReturn !== null) {
|
||||||
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authTokenToReturn);
|
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authTokenToReturn);
|
||||||
}
|
}
|
||||||
|
// @endif
|
||||||
|
|
||||||
resolve(authTokenToReturn);
|
resolve(authTokenToReturn);
|
||||||
// @endif
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue