fix desktop login

This commit is contained in:
Sean Yesmunt 2020-03-24 10:06:39 -04:00
parent cebb4dd580
commit 0ca53b7e63
2 changed files with 8 additions and 27 deletions

View file

@ -1066,5 +1066,10 @@
"Channel profile picture": "Channel profile picture",
"(%count%)": "(%count%)",
"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"
}

View file

@ -132,39 +132,15 @@ Lbryio.setOverride(
'getAuthToken',
() =>
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();
// @if TARGET='web'
if (authTokenToReturn !== null) {
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authTokenToReturn);
}
// @endif
resolve(authTokenToReturn);
// @endif
})
);