Skip to content
Snippets Groups Projects
Commit 83a7926d authored by Christian Pointner's avatar Christian Pointner
Browse files

fix session logout

parent 3f9c3811
No related branches found
No related tags found
No related merge requests found
......@@ -74,12 +74,13 @@ func login(w http.ResponseWriter, r *http.Request) {
}
func logout(w http.ResponseWriter, r *http.Request) {
_, s := getSessionFromCookie(r)
sid, s := getSessionFromCookie(r)
invalidateSessionCookie(w)
if s == nil {
http.Error(w, "Request does not contain a valid session cookie or session is already expired.", http.StatusUnauthorized)
return
}
auth.sessions.remove(sid)
http.Error(w, "You are now logged out.", http.StatusOK)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment