feat: Remove the session on the server

This commit is contained in:
Alexander Polynomdivision 2018-09-29 22:10:06 +02:00
parent 076d6c8233
commit ccb2930ed5

View File

@ -275,7 +275,16 @@ export default class Application extends React.Component<IProps> {
} }
logout = () => { 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); removeSessionToken(window);
this.props.setAuthenticated(false); this.props.setAuthenticated(false);
} }