Skip to content

Commit

Permalink
fixing linter
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldoglas committed Feb 6, 2024
1 parent 28c567f commit 0b896fd
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,33 @@ Onyx.connect({
callback: (val) => (preferredLocale = val),
});

function isSupportalToken(): boolean {
return sessionAuthTokenType === 'supportal';
}

/**
* Sets the SupportToken
*/
function setSupportAuthToken(supportAuthToken: string, email?: string, accountID?: number) {
if (supportAuthToken) {
Onyx.merge(ONYXKEYS.SESSION, {
authTokenType: 'supportal',
authToken: 'dummy-token-supportal-will-be-used',
supportAuthToken,
email,
accountID,
}).then(() => {
Log.info("[Supportal] Authtoken set");
});
} else {
Onyx.set(ONYXKEYS.SESSION, {}).then(()=> {
Log.info("[Supportal] Authtoken removed");
});
}
Onyx.set(ONYXKEYS.LAST_VISITED_PATH, '');
NetworkStore.setSupportAuthToken(supportAuthToken);
}

/**
* Clears the Onyx store and redirects user to the sign in page
*/
Expand Down Expand Up @@ -110,10 +137,6 @@ function signOut() {

}

function isSupportalToken(): boolean {
return sessionAuthTokenType === 'supportal';
}

/**
* Checks if the account is an anonymous account.
*/
Expand Down Expand Up @@ -546,29 +569,6 @@ function invalidateAuthToken() {
Onyx.merge(ONYXKEYS.SESSION, {authToken: 'pizza'});
}

/**
* Sets the SupportToken
*/
function setSupportAuthToken(supportAuthToken: string, email?: string, accountID?: number) {
if (supportAuthToken) {
Onyx.merge(ONYXKEYS.SESSION, {
authTokenType: 'supportal',
authToken: 'dummy-token-supportal-will-be-used',
supportAuthToken,
email,
accountID,
}).then(() => {
Log.info("[Supportal] Authtoken set");
});
} else {
Onyx.set(ONYXKEYS.SESSION, {}).then(()=> {
Log.info("[Supportal] Authtoken removed");
});
}
Onyx.set(ONYXKEYS.LAST_VISITED_PATH, '');
NetworkStore.setSupportAuthToken(supportAuthToken);
}

/**
* Clear the credentials and partial sign in session so the user can taken back to first Login step
*/
Expand Down

0 comments on commit 0b896fd

Please sign in to comment.