Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Remove dead code associated with AuthenticateWithAccountID #8149

Merged
merged 1 commit into from
Mar 16, 2022
Merged
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
28 changes: 0 additions & 28 deletions src/libs/API.js
Original file line number Diff line number Diff line change
@@ -333,33 +333,6 @@ function reauthenticate(command = '') {
});
}

/**
* Calls the command=Authenticate API with an accountID, validateCode, and optional 2FA code. This is used specifically
* for sharing sessions between e.com and this app. It will return an authToken that is used for initiating a session
* in this app. This API call doesn't have any special handling (like retries or special error handling).
*
* @param {Object} parameters
* @param {String} parameters.accountID
* @param {String} parameters.validateCode
* @param {String} [parameters.twoFactorAuthCode]
* @returns {Promise<unknown>}
*/
function AuthenticateWithAccountID(parameters) {
const commandName = 'Authenticate';

requireParameters([
'accountID',
'validateCode',
], parameters, commandName);

return Network.post(commandName, {
accountID: parameters.accountID,
validateCode: parameters.validateCode,
twoFactorAuthCode: parameters.twoFactorAuthCode,
shouldRetry: false,
});
}

/**
* @param {Object} parameters
* @returns {Promise}
@@ -1247,7 +1220,6 @@ function GetStatementPDF(parameters) {

export {
Authenticate,
AuthenticateWithAccountID,
AddBillingCard,
BankAccount_Create,
BankAccount_Get,
26 changes: 0 additions & 26 deletions src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
@@ -340,31 +340,6 @@ function setPassword(password, validateCode, accountID) {
});
}

/**
* This is used when a user clicks on a link from e.com that goes to this application. We want the user to be able to
* be automatically logged into this app. If the user is not already logged into this app, then this method is called
* in order to retrieve an authToken from e.com and be signed in.
*
* @param {String} accountID
* @param {String} validateCode
* @param {String} [twoFactorAuthCode]
*/
function continueSessionFromECom(accountID, validateCode, twoFactorAuthCode) {
API.AuthenticateWithAccountID({
accountID,
validateCode,
twoFactorAuthCode,
}).then((data) => {
// If something failed, it doesn't really matter what, send the user to the sign in form to log in normally
if (data.jsonCode !== 200) {
Navigation.navigate(ROUTES.HOME);
return;
}

setSuccessfulSignInData(data);
});
}

/**
* Clear the credentials and partial sign in session so the user can taken back to first Login step
*/
@@ -537,7 +512,6 @@ function setShouldShowComposeInput(shouldShowComposeInput) {
}

export {
continueSessionFromECom,
fetchAccountDetails,
setOrChangePassword,
setPassword,