From ca672dc5b510586732df02c447eed481fc046096 Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Tue, 22 Aug 2023 11:23:29 -0600 Subject: [PATCH 1/3] Update auth.ts --- src/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index 3946464901..aab36bcdcd 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -76,7 +76,7 @@ export const authClient: AuthClient = { }, async logout() { const client = await getClient(); - await client.logout({ openUrl: (url) => window.location.replace(url) }); + await client.logout({ logoutParams: { returnTo: window.location.origin } }); }, async getToken() { const client = await getClient(); From 9ef4e9b69c25a996343bae52229fd471882331ad Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Tue, 22 Aug 2023 11:28:03 -0600 Subject: [PATCH 2/3] Update auth.ts --- src/auth.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/auth.ts b/src/auth.ts index aab36bcdcd..74e1d70776 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -77,6 +77,7 @@ export const authClient: AuthClient = { async logout() { const client = await getClient(); await client.logout({ logoutParams: { returnTo: window.location.origin } }); + await new Promise((resolve) => setTimeout(resolve, 10000)); }, async getToken() { const client = await getClient(); From dcc35b5a0597923adfba6725c67b68cb765833fa Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Tue, 22 Aug 2023 11:33:52 -0600 Subject: [PATCH 3/3] Update auth.ts --- src/auth.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/auth.ts b/src/auth.ts index 74e1d70776..999a0c972f 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -77,6 +77,10 @@ export const authClient: AuthClient = { async logout() { const client = await getClient(); await client.logout({ logoutParams: { returnTo: window.location.origin } }); + // Not sure why this is the case, but manually waiting for this is what + // makes it work. Auth0 will redirect once it actually does the logout, + // otherwise this doesn't wait and it "logs out" too fast and you don't + // actually log out await new Promise((resolve) => setTimeout(resolve, 10000)); }, async getToken() {