From ccb2930ed5e910d1e7093c4f930af4deeedae662 Mon Sep 17 00:00:00 2001 From: Alexander Polynomdivision Date: Sat, 29 Sep 2018 22:10:06 +0200 Subject: [PATCH] feat: Remove the session on the server --- frontend/src/components/app.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/app.tsx b/frontend/src/components/app.tsx index ffa1d47..efee7eb 100644 --- a/frontend/src/components/app.tsx +++ b/frontend/src/components/app.tsx @@ -275,7 +275,16 @@ export default class Application extends React.Component { } 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); }