require authed user to perfrom logout

This commit is contained in:
Umputun
2019-01-16 23:28:49 -06:00
parent 79a8bfe453
commit ff46cbd173
2 changed files with 7 additions and 3 deletions
+4
View File
@@ -209,5 +209,9 @@ func (p Oauth2Handler) AuthHandler(w http.ResponseWriter, r *http.Request) {
// LogoutHandler - GET /logout
func (p Oauth2Handler) LogoutHandler(w http.ResponseWriter, r *http.Request) {
if _, _, err := p.JwtService.Get(r); err != nil {
rest.SendErrorJSON(w, r, p.L, http.StatusForbidden, err, "logout not allowed")
return
}
p.JwtService.Reset(w)
}