only set x-lbry-auth-token once user is signed in
This commit is contained in:
parent
48eac1188f
commit
16fcc4c932
3 changed files with 5 additions and 11 deletions
|
@ -44,9 +44,7 @@ class UserVerify extends React.PureComponent<Props> {
|
|||
rewards_program: (
|
||||
<Button button="link" label={__('Rewards Program')} href="https://lbry.com/faq/rewards" />
|
||||
),
|
||||
Refresh: (
|
||||
<Button icon={ICONS.REFRESH} onClick={() => fetchUser()} button="link" label={__('Refresh')} />
|
||||
),
|
||||
Refresh: <Button onClick={() => fetchUser()} button="link" label={__('Refresh')} />,
|
||||
Skip: <Button {...skipButtonProps} button="link" label={__('Skip')} />,
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -143,13 +143,6 @@ Lbryio.setOverride(
|
|||
() =>
|
||||
new Promise(resolve => {
|
||||
const authTokenToReturn = authToken || getAuthToken();
|
||||
|
||||
// @if TARGET='web'
|
||||
if (authTokenToReturn !== null) {
|
||||
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authTokenToReturn);
|
||||
}
|
||||
// @endif
|
||||
|
||||
resolve(authTokenToReturn);
|
||||
})
|
||||
);
|
||||
|
|
|
@ -46,7 +46,8 @@ import {
|
|||
import { doAuthenticate, doGetSync, doClaimRewardType, rewards as REWARDS } from 'lbryinc';
|
||||
import { lbrySettings as config, version as appVersion } from 'package.json';
|
||||
import analytics, { SHARE_INTERNAL } from 'analytics';
|
||||
import { doSignOutCleanup, deleteSavedPassword, getSavedPassword } from 'util/saved-passwords';
|
||||
import { doSignOutCleanup, deleteSavedPassword, getSavedPassword, getAuthToken } from 'util/saved-passwords';
|
||||
import { X_LBRY_AUTH_TOKEN } from 'constants/token';
|
||||
|
||||
// @if TARGET='app'
|
||||
const { autoUpdater } = remote.require('electron-updater');
|
||||
|
@ -494,6 +495,8 @@ export function doAnaltyicsPurchaseEvent(fileInfo) {
|
|||
export function doSignIn() {
|
||||
return (dispatch, getState) => {
|
||||
// @if TARGET='web'
|
||||
const authToken = getAuthToken();
|
||||
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authToken);
|
||||
dispatch(doBalanceSubscribe());
|
||||
dispatch(doFetchChannelListMine());
|
||||
// @endif
|
||||
|
|
Loading…
Add table
Reference in a new issue