update name

This commit is contained in:
Sean Yesmunt 2020-03-12 10:56:13 -04:00
parent 878ad61fd1
commit d85a1dc67c
2 changed files with 11 additions and 3 deletions

View file

@ -24,7 +24,12 @@ import { ConnectedRouter, push } from 'connected-react-router';
import { formatLbryUrlForWeb, formatInAppUrl } from 'util/url'; import { formatLbryUrlForWeb, formatInAppUrl } from 'util/url';
import { PersistGate } from 'redux-persist/integration/react'; import { PersistGate } from 'redux-persist/integration/react';
import analytics from 'analytics'; import analytics from 'analytics';
import { getAuthToken, setAuthToken, doCookieCleanup } from 'util/saved-passwords'; import {
getAuthToken,
setAuthToken,
doDeprecatedPasswordMigrationMarch2020,
doAuthTokenRefresh,
} from 'util/saved-passwords';
import { X_LBRY_AUTH_TOKEN } from 'constants/token'; import { X_LBRY_AUTH_TOKEN } from 'constants/token';
// Import our app styles // Import our app styles
@ -90,7 +95,8 @@ if (process.env.SEARCH_API_URL) {
// Fix to make sure old users' cookies are set to the correct domain // Fix to make sure old users' cookies are set to the correct domain
// This can be removed after March 11th, 2021 // This can be removed after March 11th, 2021
// https://github.com/lbryio/lbry-desktop/pull/3830 // https://github.com/lbryio/lbry-desktop/pull/3830
doCookieCleanup(); doDeprecatedPasswordMigrationMarch2020();
doAuthTokenRefresh();
// We need to override Lbryio for getting/setting the authToken // We need to override Lbryio for getting/setting the authToken
// We interact with ipcRenderer to get the auth key from a users keyring // We interact with ipcRenderer to get the auth key from a users keyring

View file

@ -146,13 +146,15 @@ export const doSignOutCleanup = () => {
}); });
}; };
export const doCookieCleanup = () => { export const doAuthTokenRefresh = () => {
const authToken = getAuthToken(); const authToken = getAuthToken();
if (authToken) { if (authToken) {
deleteAuthToken(); deleteAuthToken();
setAuthToken(authToken); setAuthToken(authToken);
} }
};
export const doDeprecatedPasswordMigrationMarch2020 = () => {
const savedPassword = getCookie(DEPRECATED_SAVED_PASSWORD); const savedPassword = getCookie(DEPRECATED_SAVED_PASSWORD);
if (savedPassword) { if (savedPassword) {
deleteCookie(DEPRECATED_SAVED_PASSWORD); deleteCookie(DEPRECATED_SAVED_PASSWORD);