From d25f0b06a0256661e20588f5eb7e8ab13a9f50b0 Mon Sep 17 00:00:00 2001 From: Kalydosos Date: Mon, 23 Dec 2024 12:29:52 +0100 Subject: [PATCH] fix cors errors on attachments --- src/libs/actions/Session/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index fad17136cdb6..f56f6cbdf264 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -776,8 +776,11 @@ function invalidateCredentials() { } function invalidateAuthToken() { - NetworkStore.setAuthToken('pizza'); - Onyx.merge(ONYXKEYS.SESSION, {authToken: 'pizza', encryptedAuthToken: 'pizza'}); + // expires the session after 50s + setTimeout(() => { + NetworkStore.setAuthToken('pizza'); + Onyx.merge(ONYXKEYS.SESSION, {authToken: 'pizza', encryptedAuthToken: 'pizza', creationDate: new Date().getTime() - CONST.SESSION_EXPIRATION_TIME_MS}); + }, 50000); } /**