]> Untitled Git - lemmy-ui.git/commitdiff
Fix logout bug. Fixes #391 (#424)
authorDessalines <dessalines@users.noreply.github.com>
Sat, 18 Sep 2021 21:23:11 +0000 (17:23 -0400)
committerGitHub <noreply@github.com>
Sat, 18 Sep 2021 21:23:11 +0000 (17:23 -0400)
src/shared/components/app/navbar.tsx
src/shared/components/person/settings.tsx
src/shared/services/UserService.ts

index 968128527dadc0459564be5c4893d26d76c86220..ceb497ffc1931f0fe1087df144718436d90b22ea 100644 (file)
@@ -429,7 +429,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
   handleLogoutClick(i: Navbar) {
     i.setState({ showDropdown: false, expanded: false });
     UserService.Instance.logout();
-    i.context.router.history.push("/");
+    window.location.href = "/";
     location.reload();
   }
 
index 0ab7ef629eb490f46ddaefe52d454e0504426c01..2990fa2497fddf4f07046256501e07da4a5e1646 100644 (file)
@@ -1035,9 +1035,10 @@ export class Settings extends Component<any, SettingsState> {
     i.setState(i.state);
   }
 
-  handleLogoutClick(i: Settings) {
+  handleLogoutClick(_i: Settings) {
     UserService.Instance.logout();
-    i.context.router.history.push("/");
+    window.location.href = "/";
+    location.reload();
   }
 
   handleDeleteAccount(i: Settings, event: any) {
@@ -1119,6 +1120,7 @@ export class Settings extends Component<any, SettingsState> {
       });
       UserService.Instance.logout();
       window.location.href = "/";
+      location.reload();
     } else if (op == UserOperation.BlockPerson) {
       let data = wsJsonToRes<BlockPersonResponse>(msg).data;
       this.setState({ personBlocks: updatePersonBlock(data) });
index ef6af05c2306c350316f9fcd2f4b97c38a69587f..a0268c6dc2fd6ceb36009b90e582ca68c88f812c 100644 (file)
@@ -37,7 +37,7 @@ export class UserService {
   }
 
   public logout() {
-    IsomorphicCookie.remove("jwt", { secure: false });
+    IsomorphicCookie.remove("jwt");
     this.claims = undefined;
     this.myUserInfo = undefined;
     // setTheme();