feat: Remove the session on the server
This commit is contained in:
parent
076d6c8233
commit
ccb2930ed5
@ -275,7 +275,16 @@ export default class Application extends React.Component<IProps> {
|
||||
}
|
||||
|
||||
logout = () => {
|
||||
// TODO: Tell the server that we're logging ourselves out
|
||||
// NOTE: No promise, since we don't care about the result
|
||||
fetch(`${BACKEND_URL}/api/user/logout`, {
|
||||
headers: new Headers({
|
||||
"Content-Type": "application/json",
|
||||
"Token": this.props.user.sessionToken,
|
||||
}),
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
// Remove the session locally
|
||||
removeSessionToken(window);
|
||||
this.props.setAuthenticated(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user