Skip to content

Commit

Permalink
Merge pull request Expensify#6915 from kidroca/kidroca/fix-encrypted-…
Browse files Browse the repository at this point in the history
…token-migration

[No QA] Fix api usage inside `AddEncryptedAuthToken` migration
  • Loading branch information
marcaaron authored Dec 30, 2021
2 parents 6cf4a72 + 58db73d commit 74738c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/migrations/AddEncryptedAuthToken.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable rulesdir/no-api-in-views */
import _ from 'underscore';
import Onyx from 'react-native-onyx';
import Log from '../Log';
import ONYXKEYS from '../../ONYXKEYS';
import * as reauthenticate from '../API';
import * as API from '../API';

/**
* This migration adds an encryptedAuthToken to the SESSION key, if it is not present.
Expand All @@ -28,7 +29,7 @@ export default function () {

// If there is an auth token but no encrypted auth token, reauthenticate.
if (session.authToken && _.isUndefined(session.encryptedAuthToken)) {
return reauthenticate('Onyx_Migration_AddEncryptedAuthToken')
return API.reauthenticate('Onyx_Migration_AddEncryptedAuthToken')
.then(() => {
Log.info('[Migrate Onyx] Ran migration AddEncryptedAuthToken');
return resolve();
Expand Down

0 comments on commit 74738c3

Please sign in to comment.