From: sam365724 <111515092+sam365724@users.noreply.github.com> Date: Wed, 2 Nov 2022 18:32:30 +0000 (+0100) Subject: Fix workaround for broken logout (#836) X-Git-Url: http://these/git/%7B%60https:/%7B%60%24%7BrepoUrl%7D?a=commitdiff_plain;h=8fdbaf4499d384b6afd94f6b14c139a2851fb25d;p=lemmy-ui.git Fix workaround for broken logout (#836) Use hostname without port for setting empty cookie, avoids error in browser: Cookie “jwt” has been rejected for invalid domain. --- diff --git a/src/shared/services/UserService.ts b/src/shared/services/UserService.ts index 8d591cc..b97d506 100644 --- a/src/shared/services/UserService.ts +++ b/src/shared/services/UserService.ts @@ -52,7 +52,7 @@ export class UserService { this.jwtInfo = None; this.myUserInfo = None; IsomorphicCookie.remove("jwt"); // TODO is sometimes unreliable for some reason - document.cookie = "jwt=; Max-Age=0; path=/; domain=" + location.host; + document.cookie = "jwt=; Max-Age=0; path=/; domain=" + location.hostname; location.reload(); }