From c8b12a59e222ec289cc8802fc7e32243d9489a1e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 4 Sep 2022 12:56:12 +0200 Subject: [PATCH] fix: Post-signin redirect path is no longer saved (#4054) closes #4045 --- app/stores/AuthStore.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/stores/AuthStore.ts b/app/stores/AuthStore.ts index 55d908a0e..5f4d80168 100644 --- a/app/stores/AuthStore.ts +++ b/app/stores/AuthStore.ts @@ -260,12 +260,6 @@ export default class AuthStore { @action logout = async (savePath = false) => { - if (!this.token) { - return; - } - - client.post(`/auth.delete`); - // if this logout was forced from an authenticated route then // save the current path so we can go back there once signed in if (savePath) { @@ -276,10 +270,19 @@ export default class AuthStore { } } + // If there is no auth token stored there is nothing else to do + if (!this.token) { + return; + } + + // invalidate authentication token on server + client.post(`/auth.delete`); + // remove authentication token itself removeCookie("accessToken", { path: "/", }); + // remove session record on apex cookie const team = this.team;