Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ const CONST = {
PRIVACY_URL: 'https://use.expensify.com/privacy',
LICENSES_URL: 'https://use.expensify.com/licenses',
PLAY_STORE_URL: 'https://play.google.com/store/apps/details?id=com.expensify.chat&hl=en',
ADD_SECONDARY_LOGIN_URL: '/settings?param={%22section%22:%22account%22}',
MANAGE_CARDS_URL: '/domain_companycards',
ADD_SECONDARY_LOGIN_URL: 'settings?param={%22section%22:%22account%22}',
MANAGE_CARDS_URL: 'domain_companycards',
FEES_URL: 'https://use.expensify.com/fees',
CFPB_PREPAID_URL: 'https://cfpb.gov/prepaid',
STAGING_SECURE_URL: 'https://staging-secure.expensify.com/',
Expand Down
8 changes: 4 additions & 4 deletions src/libs/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ function GetAccountStatus(parameters) {
}

/**
* Returns a validate code for this account
* Returns a short lived authToken for this account
* @returns {Promise}
*/
function GetAccountValidateCode() {
const commandName = 'GetAccountValidateCode';
function GetShortLivedAuthToken() {
const commandName = 'GetShortLivedAuthToken';
return Network.post(commandName);
}

Expand Down Expand Up @@ -1086,7 +1086,7 @@ export {
DeleteLogin,
Get,
GetAccountStatus,
GetAccountValidateCode,
GetShortLivedAuthToken,
GetIOUReport,
GetPolicyList,
GetPolicySummaryList,
Expand Down
6 changes: 2 additions & 4 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ function setLocale(locale) {
* @param {string} url relative URL starting with `/` to open in expensify.com
*/
function openSignedInLink(url = '') {
API.GetAccountValidateCode().then((response) => {
const exitToURL = url ? `?exitTo=${url}` : '';
const validateCodeUrl = `v/${currentUserAccountID}/${response.validateCode}${exitToURL}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come there is no more exitTo param?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exitTo was there for the validate page to redirect to the page we wanted after validating. Now, we don't need it because we send users directly to the page we want, without any intermediary pages

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks!

Linking.openURL(CONFIG.EXPENSIFY.URL_EXPENSIFY_COM + validateCodeUrl);
API.GetShortLivedAuthToken().then((response) => {
Linking.openURL(`${CONFIG.EXPENSIFY.URL_EXPENSIFY_COM}${url}${url.indexOf('?') === -1 ? '?' : '&'}authToken=${response.authToken}&email=${encodeURIComponent(response.email)}`);
});
}

Expand Down