From: SleeplessOne1917 Date: Sat, 13 May 2023 14:38:43 +0000 (-0400) Subject: Redirect fomr pages that require auth on logout X-Git-Url: http://these/git/%24%7B%60data:application/static/%7B%60https:/%7Brss%7D?a=commitdiff_plain;h=f31cd42d8e7f4b1edd2085470349a8de3d922d91;p=lemmy-ui.git Redirect fomr pages that require auth on logout --- diff --git a/src/shared/services/UserService.ts b/src/shared/services/UserService.ts index e4ec5f9..b5f8d26 100644 --- a/src/shared/services/UserService.ts +++ b/src/shared/services/UserService.ts @@ -48,7 +48,15 @@ export class UserService { this.myUserInfo = undefined; IsomorphicCookie.remove("jwt"); // TODO is sometimes unreliable for some reason document.cookie = "jwt=; Max-Age=0; path=/; domain=" + location.hostname; - location.reload(); + if ( + /create_.*|inbox|settings|setup|admin|reports|registration_applications/g.test( + location.pathname + ) + ) { + location.replace("/"); + } else { + location.reload(); + } } public auth(throwErr = true): string | undefined {