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/%22%7Burl%7D/%22https:/image.com/%7BimageSrc%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 {