From 3bd2c1cfd35985416f26cd940f2eb23e37b43e2f Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 14 Jan 2023 02:01:38 +0800 Subject: [PATCH] Catch logout error (#17139) --- app/src/auth.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/auth.ts b/app/src/auth.ts index 2528b26bfb..1fcac3071b 100644 --- a/app/src/auth.ts +++ b/app/src/auth.ts @@ -170,7 +170,11 @@ export async function logout(optionsRaw: LogoutOptions = {}): Promise { // Only if the user manually signed out should we kill the session by hitting the logout endpoint if (options.reason === LogoutReason.SIGN_OUT) { - await api.post(`/auth/logout`); + try { + await api.post(`/auth/logout`); + } catch { + // User already signed out + } } appStore.authenticated = false;