Fix logout bug. Fixes #391 (#424)

This commit is contained in:
Dessalines 2021-09-18 17:23:11 -04:00 committed by GitHub
parent 8f132f67fa
commit 9a26d4bbdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View 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();
}

View 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) });

View 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();