diff --git a/ui/index.jsx b/ui/index.jsx index b10c90b3a..909da5bb2 100644 --- a/ui/index.jsx +++ b/ui/index.jsx @@ -24,7 +24,12 @@ import { ConnectedRouter, push } from 'connected-react-router'; import { formatLbryUrlForWeb, formatInAppUrl } from 'util/url'; import { PersistGate } from 'redux-persist/integration/react'; 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 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 // This can be removed after March 11th, 2021 // https://github.com/lbryio/lbry-desktop/pull/3830 -doCookieCleanup(); +doDeprecatedPasswordMigrationMarch2020(); +doAuthTokenRefresh(); // We need to override Lbryio for getting/setting the authToken // We interact with ipcRenderer to get the auth key from a users keyring diff --git a/ui/util/saved-passwords.js b/ui/util/saved-passwords.js index eb9fbc954..bc7946daf 100644 --- a/ui/util/saved-passwords.js +++ b/ui/util/saved-passwords.js @@ -146,13 +146,15 @@ export const doSignOutCleanup = () => { }); }; -export const doCookieCleanup = () => { +export const doAuthTokenRefresh = () => { const authToken = getAuthToken(); if (authToken) { deleteAuthToken(); setAuthToken(authToken); } +}; +export const doDeprecatedPasswordMigrationMarch2020 = () => { const savedPassword = getCookie(DEPRECATED_SAVED_PASSWORD); if (savedPassword) { deleteCookie(DEPRECATED_SAVED_PASSWORD);