From 0e1c2711c5a9d1ff972a6c202f26c4ed7a08b535 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 15 Jun 2021 12:25:19 -0700 Subject: [PATCH 1/5] Use encryptedAuthToken for images in E.cash --- .../AnchorForCommentsOnly/AnchorWithAuthToken.js | 10 +++++----- src/components/AttachmentModal.js | 8 ++++---- src/components/ThumbnailImage.js | 8 ++++---- src/libs/actions/Session.js | 13 +++++++------ ...hTokenToURL.js => addEncryptedAuthTokenToURL.js} | 6 +++--- 5 files changed, 23 insertions(+), 22 deletions(-) rename src/libs/{addAuthTokenToURL.js => addEncryptedAuthTokenToURL.js} (55%) diff --git a/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js b/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js index 14440fc60dee..6d6abb346bb5 100644 --- a/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js +++ b/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js @@ -8,13 +8,13 @@ import { defaultProps as anchorForCommentsOnlyDefaultProps, } from './anchorForCommentsOnlyPropTypes'; import BaseAnchorForCommentsOnly from './BaseAnchorForCommentsOnly'; -import addAuthTokenToURL from '../../libs/addAuthTokenToURL'; +import addEncryptedAuthTokenToURL from '../../libs/addEncryptedAuthTokenToURL'; const propTypes = { /** Session info for the currently logged in user. */ session: PropTypes.shape({ /** Currently logged in user authToken */ - authToken: PropTypes.string, + encryptedAuthToken: PropTypes.string, }), ...anchorForCommentsOnlyPropTypes, @@ -22,15 +22,15 @@ const propTypes = { const defaultProps = { session: { - authToken: null, + encryptedAuthToken: null, }, ...anchorForCommentsOnlyDefaultProps, }; const AnchorWithAuthToken = (props) => { - const urlWithAuthToken = addAuthTokenToURL({ + const urlWithAuthToken = addEncryptedAuthTokenToURL({ url: props.href, - authToken: props.session.authToken, + encryptedAuthToken: props.session.encryptedAuthToken, }); const propsToPass = _.omit(props, 'session'); propsToPass.href = urlWithAuthToken; diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 599456e55442..f779c23668f7 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -9,7 +9,7 @@ import AttachmentView from './AttachmentView'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; import ONYXKEYS from '../ONYXKEYS'; -import addAuthTokenToURL from '../libs/addAuthTokenToURL'; +import addEncryptedAuthTokenToURL from '../libs/addEncryptedAuthTokenToURL'; import compose from '../libs/compose'; import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; import Button from './Button'; @@ -43,7 +43,7 @@ const propTypes = { /** Current user session */ session: PropTypes.shape({ - authToken: PropTypes.string.isRequired, + encryptedAuthToken: PropTypes.string.isRequired, }).isRequired, ...withLocalizePropTypes, @@ -89,9 +89,9 @@ class AttachmentModal extends PureComponent { } render() { - const sourceURL = addAuthTokenToURL({ + const sourceURL = addEncryptedAuthTokenToURL({ url: this.state.sourceURL, - authToken: this.props.session.authToken, + encryptedAuthToken: this.props.session.encryptedAuthToken, required: this.props.isAuthTokenRequired, }); diff --git a/src/components/ThumbnailImage.js b/src/components/ThumbnailImage.js index 83280826602f..9724db09b07f 100644 --- a/src/components/ThumbnailImage.js +++ b/src/components/ThumbnailImage.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; import ONYXKEYS from '../ONYXKEYS'; import ImageWithSizeCalculation from './ImageWithSizeCalculation'; -import addAuthTokenToURL from '../libs/addAuthTokenToURL'; +import addEncryptedAuthTokenToURL from '../libs/addEncryptedAuthTokenToURL'; import styles, {getWidthAndHeightStyle} from '../styles/styles'; const propTypes = { @@ -17,7 +17,7 @@ const propTypes = { /** Current user session */ session: PropTypes.shape({ - authToken: PropTypes.string.isRequired, + encryptedAuthToken: PropTypes.string.isRequired, }).isRequired, /** Do the urls require an authToken? */ @@ -50,9 +50,9 @@ class ThumbnailImage extends PureComponent { } render() { - const url = addAuthTokenToURL({ + const url = addEncryptedAuthTokenToURL({ url: this.props.previewSourceURL, - authToken: this.props.session.authToken, + encryptedAuthToken: this.props.session.encryptedAuthToken, required: this.props.isAuthTokenRequired, }); diff --git a/src/libs/actions/Session.js b/src/libs/actions/Session.js index 07d545059fad..abb06fe2cc3f 100644 --- a/src/libs/actions/Session.js +++ b/src/libs/actions/Session.js @@ -25,7 +25,7 @@ function setSuccessfulSignInData(data) { PushNotification.register(data.accountID); Onyx.merge(ONYXKEYS.SESSION, { shouldShowComposeInput: true, - ..._.pick(data, 'authToken', 'accountID', 'email'), + ..._.pick(data, 'authToken', 'accountID', 'email', 'encryptedAuthToken'), }); } @@ -143,9 +143,10 @@ function fetchAccountDetails(login) { * re-authenticating after an authToken expires. * * @param {String} authToken + * @param {String} encryptedAuthToken * @param {String} email */ -function createTemporaryLogin(authToken, email) { +function createTemporaryLogin(authToken, encryptedAuthToken, email) { const autoGeneratedLogin = Str.guid('expensify.cash-'); const autoGeneratedPassword = Str.guid(); @@ -163,7 +164,7 @@ function createTemporaryLogin(authToken, email) { throw new Error(createLoginResponse.message); } - setSuccessfulSignInData(createLoginResponse); + setSuccessfulSignInData({...createLoginResponse, encryptedAuthToken}); // If we have an old generated login for some reason // we should delete it before storing the new details @@ -211,8 +212,8 @@ function signIn(password, twoFactorAuthCode) { email: credentials.login, }) .then((authenticateResponse) => { - const {authToken, email} = authenticateResponse; - createTemporaryLogin(authToken, email); + const {authToken, encryptedAuthToken, email} = authenticateResponse; + createTemporaryLogin(authToken, encryptedAuthToken, email); }) .catch((error) => { Onyx.merge(ONYXKEYS.ACCOUNT, {error: error.message, loading: false}); @@ -256,7 +257,7 @@ function setPassword(password, validateCode, accountID) { }) .then((response) => { if (response.jsonCode === 200) { - createTemporaryLogin(response.authToken, response.email); + createTemporaryLogin(response.authToken, response.encryptedAuthToken, response.email); return; } diff --git a/src/libs/addAuthTokenToURL.js b/src/libs/addEncryptedAuthTokenToURL.js similarity index 55% rename from src/libs/addAuthTokenToURL.js rename to src/libs/addEncryptedAuthTokenToURL.js index 41c89590385b..a48596b7a157 100644 --- a/src/libs/addAuthTokenToURL.js +++ b/src/libs/addEncryptedAuthTokenToURL.js @@ -4,11 +4,11 @@ * @param {Object} parameters * @param {String} parameters.url * @param {Boolean} parameters.required - * @param {String} parameters.authToken + * @param {String} parameters.encryptedAuthToken * @returns {String} */ -export default function ({url, authToken, required = true}) { +export default function ({url, encryptedAuthToken, required = true}) { return required - ? `${url}?authToken=${authToken}` + ? `${url}?encryptedAuthToken=${encryptedAuthToken}` : url; } From 451d2057f197ac4deed8ab0631adb5c12a47048f Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 15 Jun 2021 13:28:42 -0700 Subject: [PATCH 2/5] Remove redundant onyx subscriptions --- .../AnchorWithAuthToken.js | 50 ------------------- src/components/AnchorForCommentsOnly/index.js | 13 ++--- src/components/AttachmentModal.js | 20 ++------ src/components/ThumbnailImage.js | 21 ++------ src/libs/addEncryptedAuthTokenToURL.js | 20 +++++--- 5 files changed, 26 insertions(+), 98 deletions(-) delete mode 100644 src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js diff --git a/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js b/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js deleted file mode 100644 index 6d6abb346bb5..000000000000 --- a/src/components/AnchorForCommentsOnly/AnchorWithAuthToken.js +++ /dev/null @@ -1,50 +0,0 @@ -import _ from 'underscore'; -import React from 'react'; -import PropTypes from 'prop-types'; -import {withOnyx} from 'react-native-onyx'; -import ONYXKEYS from '../../ONYXKEYS'; -import { - propTypes as anchorForCommentsOnlyPropTypes, - defaultProps as anchorForCommentsOnlyDefaultProps, -} from './anchorForCommentsOnlyPropTypes'; -import BaseAnchorForCommentsOnly from './BaseAnchorForCommentsOnly'; -import addEncryptedAuthTokenToURL from '../../libs/addEncryptedAuthTokenToURL'; - -const propTypes = { - /** Session info for the currently logged in user. */ - session: PropTypes.shape({ - /** Currently logged in user authToken */ - encryptedAuthToken: PropTypes.string, - }), - - ...anchorForCommentsOnlyPropTypes, -}; - -const defaultProps = { - session: { - encryptedAuthToken: null, - }, - ...anchorForCommentsOnlyDefaultProps, -}; - -const AnchorWithAuthToken = (props) => { - const urlWithAuthToken = addEncryptedAuthTokenToURL({ - url: props.href, - encryptedAuthToken: props.session.encryptedAuthToken, - }); - const propsToPass = _.omit(props, 'session'); - propsToPass.href = urlWithAuthToken; - propsToPass.shouldDownloadFile = true; - // eslint-disable-next-line react/jsx-props-no-spreading - return ; -}; - -AnchorWithAuthToken.propTypes = propTypes; -AnchorWithAuthToken.defaultProps = defaultProps; -AnchorWithAuthToken.displayName = 'AnchorWithAuthToken'; - -export default withOnyx({ - session: { - key: ONYXKEYS.SESSION, - }, -})(AnchorWithAuthToken); diff --git a/src/components/AnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/index.js index 6a5daf6a672b..080324d755d6 100644 --- a/src/components/AnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/index.js @@ -5,8 +5,8 @@ import { propTypes as anchorForCommentsOnlyPropTypes, defaultProps as anchorForCommentsOnlyDefaultProps, } from './anchorForCommentsOnlyPropTypes'; -import AnchorWithAuthToken from './AnchorWithAuthToken'; import BaseAnchorForCommentsOnly from './BaseAnchorForCommentsOnly'; +import addEncryptedAuthTokenToURL from '../../libs/addEncryptedAuthTokenToURL'; const propTypes = { /** Do we need an auth token to view this link or download the remote resource? */ @@ -27,11 +27,12 @@ const defaultProps = { */ const AnchorForCommentsOnly = (props) => { const propsToPass = _.omit(props, 'isAuthTokenRequired'); - return props.isAuthTokenRequired - // eslint-disable-next-line react/jsx-props-no-spreading - ? - // eslint-disable-next-line react/jsx-props-no-spreading - : ; + if (props.isAuthTokenRequired) { + propsToPass.href = addEncryptedAuthTokenToURL(props.href); + propsToPass.shouldDownloadFile = true; + } + // eslint-disable-next-line react/jsx-props-no-spreading + return ; }; AnchorForCommentsOnly.propTypes = propTypes; diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index f779c23668f7..6207fa5bb2f8 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -2,13 +2,11 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import {View} from 'react-native'; import Str from 'expensify-common/lib/str'; -import {withOnyx} from 'react-native-onyx'; import CONST from '../CONST'; import Modal from './Modal'; import AttachmentView from './AttachmentView'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; -import ONYXKEYS from '../ONYXKEYS'; import addEncryptedAuthTokenToURL from '../libs/addEncryptedAuthTokenToURL'; import compose from '../libs/compose'; import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; @@ -41,11 +39,6 @@ const propTypes = { /** Do the urls require an authToken? */ isAuthTokenRequired: PropTypes.bool, - /** Current user session */ - session: PropTypes.shape({ - encryptedAuthToken: PropTypes.string.isRequired, - }).isRequired, - ...withLocalizePropTypes, ...windowDimensionsPropTypes, @@ -89,11 +82,9 @@ class AttachmentModal extends PureComponent { } render() { - const sourceURL = addEncryptedAuthTokenToURL({ - url: this.state.sourceURL, - encryptedAuthToken: this.props.session.encryptedAuthToken, - required: this.props.isAuthTokenRequired, - }); + const sourceURL = this.props.isAuthTokenRequired + ? addEncryptedAuthTokenToURL(this.state.sourceURL) + : this.state.sourceURL; const attachmentViewStyles = this.props.isSmallScreenWidth ? [styles.imageModalImageCenterContainer] @@ -164,10 +155,5 @@ AttachmentModal.propTypes = propTypes; AttachmentModal.defaultProps = defaultProps; export default compose( withWindowDimensions, - withOnyx({ - session: { - key: ONYXKEYS.SESSION, - }, - }), withLocalize, )(AttachmentModal); diff --git a/src/components/ThumbnailImage.js b/src/components/ThumbnailImage.js index 9724db09b07f..e1bebb06656a 100644 --- a/src/components/ThumbnailImage.js +++ b/src/components/ThumbnailImage.js @@ -1,8 +1,6 @@ import React, {PureComponent} from 'react'; import {View} from 'react-native'; import PropTypes from 'prop-types'; -import {withOnyx} from 'react-native-onyx'; -import ONYXKEYS from '../ONYXKEYS'; import ImageWithSizeCalculation from './ImageWithSizeCalculation'; import addEncryptedAuthTokenToURL from '../libs/addEncryptedAuthTokenToURL'; import styles, {getWidthAndHeightStyle} from '../styles/styles'; @@ -15,11 +13,6 @@ const propTypes = { // eslint-disable-next-line react/forbid-prop-types style: PropTypes.any, - /** Current user session */ - session: PropTypes.shape({ - encryptedAuthToken: PropTypes.string.isRequired, - }).isRequired, - /** Do the urls require an authToken? */ isAuthTokenRequired: PropTypes.bool.isRequired, }; @@ -50,11 +43,9 @@ class ThumbnailImage extends PureComponent { } render() { - const url = addEncryptedAuthTokenToURL({ - url: this.props.previewSourceURL, - encryptedAuthToken: this.props.session.encryptedAuthToken, - required: this.props.isAuthTokenRequired, - }); + const url = this.props.isAuthTokenRequired + ? addEncryptedAuthTokenToURL(this.props.previewSourceURL) + : this.props.previewSourceURL; return ( encryptedAuthToken = session.encryptedAuthToken, +}); + /** * Add authToken to this attachment URL if necessary * - * @param {Object} parameters - * @param {String} parameters.url - * @param {Boolean} parameters.required - * @param {String} parameters.encryptedAuthToken + * @param {String} url * @returns {String} */ -export default function ({url, encryptedAuthToken, required = true}) { - return required - ? `${url}?encryptedAuthToken=${encryptedAuthToken}` - : url; +export default function (url) { + return `${url}?encryptedAuthToken=${encryptedAuthToken}`; } From 859726df124bcd9a88d0d832d697090d80d6e88c Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 15 Jun 2021 14:11:48 -0700 Subject: [PATCH 3/5] Add onyx migration --- src/libs/API.js | 5 ++- src/libs/migrateOnyx.js | 2 + src/libs/migrations/AddEncryptedAuthToken.js | 42 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/libs/migrations/AddEncryptedAuthToken.js diff --git a/src/libs/API.js b/src/libs/API.js index 75b37492e726..dbcd9c428caa 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -266,7 +266,10 @@ function reauthenticate(command = '') { // Update authToken in Onyx and in our local variables so that API requests will use the // new authToken - Onyx.merge(ONYXKEYS.SESSION, {authToken: response.authToken}); + Onyx.merge(ONYXKEYS.SESSION, { + authToken: response.authToken, + encryptedAuthToken: response.encryptedAuthToken, + }); authToken = response.authToken; // The authentication process is finished so the network can be unpaused to continue diff --git a/src/libs/migrateOnyx.js b/src/libs/migrateOnyx.js index 8b0d428076c2..3466bc2606b6 100644 --- a/src/libs/migrateOnyx.js +++ b/src/libs/migrateOnyx.js @@ -1,3 +1,4 @@ +import AddEncryptedAuthToken from './migrations/AddEncryptedAuthToken'; import RenameActiveClientsKey from './migrations/RenameActiveClientsKey'; import RenamePriorityModeKey from './migrations/RenamePriorityModeKey'; @@ -10,6 +11,7 @@ export default function () { const migrationPromises = [ RenameActiveClientsKey, RenamePriorityModeKey, + AddEncryptedAuthToken, ]; // Reduce all promises down to a single promise. All promises run in a linear fashion, waiting for the diff --git a/src/libs/migrations/AddEncryptedAuthToken.js b/src/libs/migrations/AddEncryptedAuthToken.js new file mode 100644 index 000000000000..522482d8048e --- /dev/null +++ b/src/libs/migrations/AddEncryptedAuthToken.js @@ -0,0 +1,42 @@ +import _ from 'underscore'; +import Onyx from 'react-native-onyx'; +import ONYXKEYS from '../../ONYXKEYS'; +import {reauthenticate} from '../API'; + +const reauthenticateThrottled = _.throttle(reauthenticate, 5000); + +/** + * This migration adds an encryptedAuthToken to the SESSION key, if it is not present. + * + * @returns {Promise} + */ +export default function () { + return new Promise((resolve) => { + const connectionID = Onyx.connect({ + key: ONYXKEYS.SESSION, + callback: (session) => { + Onyx.disconnect(connectionID); + + if (session && !_.isEmpty(session.encryptedAuthToken)) { + console.debug('[Onyx Migration] Skipped migration AddEncryptedAuthToken'); + return resolve(); + } + + if (!session || !session.authToken) { + console.debug('[Onyx Migration] Skipped migration AddEncryptedAuthToken'); + return resolve(); + } + + // If there is an auth token but no encrypted auth token, reauthenticate. + if (session.authToken && _.isUndefined(session.encryptedAuthToken)) { + return reauthenticateThrottled('Onyx_Migration_AddEncryptedAuthToken') + .then(() => { + console.debug('[Onyx Migration] Ran migration AddEncryptedAuthToken'); + }); + } + + return resolve(); + }, + }); + }); +} From e830882c87bed65d3e2fcb02ce946adf2d1b1680 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 17 Jun 2021 16:39:58 -0700 Subject: [PATCH 4/5] Fix migration and NABs --- src/libs/addEncryptedAuthTokenToURL.js | 5 +++-- src/libs/migrations/AddEncryptedAuthToken.js | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libs/addEncryptedAuthTokenToURL.js b/src/libs/addEncryptedAuthTokenToURL.js index a1ec0e4bc253..d7a06b6745f2 100644 --- a/src/libs/addEncryptedAuthTokenToURL.js +++ b/src/libs/addEncryptedAuthTokenToURL.js @@ -1,14 +1,15 @@ +import lodashGet from 'lodash/get'; import Onyx from 'react-native-onyx'; import ONYXKEYS from '../ONYXKEYS'; let encryptedAuthToken = ''; Onyx.connect({ key: ONYXKEYS.SESSION, - callback: session => encryptedAuthToken = session.encryptedAuthToken, + callback: session => encryptedAuthToken = lodashGet(session, 'encryptedAuthToken', ''), }); /** - * Add authToken to this attachment URL if necessary + * Add encryptedAuthToken to this attachment URL if necessary * * @param {String} url * @returns {String} diff --git a/src/libs/migrations/AddEncryptedAuthToken.js b/src/libs/migrations/AddEncryptedAuthToken.js index 522482d8048e..fe7730e26d81 100644 --- a/src/libs/migrations/AddEncryptedAuthToken.js +++ b/src/libs/migrations/AddEncryptedAuthToken.js @@ -3,8 +3,6 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; import {reauthenticate} from '../API'; -const reauthenticateThrottled = _.throttle(reauthenticate, 5000); - /** * This migration adds an encryptedAuthToken to the SESSION key, if it is not present. * @@ -18,20 +16,21 @@ export default function () { Onyx.disconnect(connectionID); if (session && !_.isEmpty(session.encryptedAuthToken)) { - console.debug('[Onyx Migration] Skipped migration AddEncryptedAuthToken'); + console.debug('[Migrate Onyx] Skipped migration AddEncryptedAuthToken'); return resolve(); } if (!session || !session.authToken) { - console.debug('[Onyx Migration] Skipped migration AddEncryptedAuthToken'); + console.debug('[Migrate Onyx] Skipped migration AddEncryptedAuthToken'); return resolve(); } // If there is an auth token but no encrypted auth token, reauthenticate. if (session.authToken && _.isUndefined(session.encryptedAuthToken)) { - return reauthenticateThrottled('Onyx_Migration_AddEncryptedAuthToken') + return reauthenticate('Onyx_Migration_AddEncryptedAuthToken') .then(() => { - console.debug('[Onyx Migration] Ran migration AddEncryptedAuthToken'); + console.debug('[Migrate Onyx] Ran migration AddEncryptedAuthToken'); + resolve(); }); } From cf8ec7ee4b1848c9aba022d4dcc63180542ff365 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Fri, 18 Jun 2021 09:46:58 -0700 Subject: [PATCH 5/5] Fix NAB comments --- src/libs/actions/Session.js | 2 +- src/libs/addEncryptedAuthTokenToURL.js | 2 +- src/libs/migrations/AddEncryptedAuthToken.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Session.js b/src/libs/actions/Session.js index abb06fe2cc3f..891d9b01768d 100644 --- a/src/libs/actions/Session.js +++ b/src/libs/actions/Session.js @@ -143,7 +143,7 @@ function fetchAccountDetails(login) { * re-authenticating after an authToken expires. * * @param {String} authToken - * @param {String} encryptedAuthToken + * @param {String} encryptedAuthToken – Not required for the CreateLogin API call, but passed to setSuccessfulSignInData * @param {String} email */ function createTemporaryLogin(authToken, encryptedAuthToken, email) { diff --git a/src/libs/addEncryptedAuthTokenToURL.js b/src/libs/addEncryptedAuthTokenToURL.js index d7a06b6745f2..82c4c1ac640f 100644 --- a/src/libs/addEncryptedAuthTokenToURL.js +++ b/src/libs/addEncryptedAuthTokenToURL.js @@ -9,7 +9,7 @@ Onyx.connect({ }); /** - * Add encryptedAuthToken to this attachment URL if necessary + * Add encryptedAuthToken to this attachment URL * * @param {String} url * @returns {String} diff --git a/src/libs/migrations/AddEncryptedAuthToken.js b/src/libs/migrations/AddEncryptedAuthToken.js index fe7730e26d81..24660b4f3a91 100644 --- a/src/libs/migrations/AddEncryptedAuthToken.js +++ b/src/libs/migrations/AddEncryptedAuthToken.js @@ -30,7 +30,7 @@ export default function () { return reauthenticate('Onyx_Migration_AddEncryptedAuthToken') .then(() => { console.debug('[Migrate Onyx] Ran migration AddEncryptedAuthToken'); - resolve(); + return resolve(); }); }