Skip to content

Commit

Permalink
fix: return authToken as is from NetworkStore
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Jun 12, 2024
1 parent bfcf8b3 commit 03f243d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/libs/Network/NetworkStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ function isOffline(): boolean {
return offline;
}

function getAuthToken(): string | null {
return authToken ?? null;
function getAuthToken(): string | null | undefined {
return authToken;
}

function isSupportRequest(command: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Network/enhanceParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function enhanceParameters(command: string, parameters: Record<st
const finalParameters = {...parameters};

if (isAuthTokenRequired(command) && !parameters.authToken) {
finalParameters.authToken = NetworkStore.getAuthToken();
finalParameters.authToken = NetworkStore.getAuthToken() ?? null;
}

finalParameters.referer = CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function signOut() {
Log.info('Flushing logs before signing out', true, {}, true);
const params = {
// Send current authToken because we will immediately clear it once triggering this command
authToken: NetworkStore.getAuthToken(),
authToken: NetworkStore.getAuthToken() ?? null,
partnerUserID: credentials?.autoGeneratedLogin ?? '',
partnerName: CONFIG.EXPENSIFY.PARTNER_NAME,
partnerPassword: CONFIG.EXPENSIFY.PARTNER_PASSWORD,
Expand Down

0 comments on commit 03f243d

Please sign in to comment.