mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-06 21:04:11 +02:00
cookie: enabled / disabled.
This commit is contained in:
parent
9b1deb4134
commit
04d2fa8863
5 changed files with 30 additions and 6 deletions
|
@ -70,7 +70,10 @@ func (api *ApiManagerCtx) Authenticate(next http.Handler) http.Handler {
|
|||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session, err := api.sessions.Authenticate(r)
|
||||
if err != nil {
|
||||
api.sessions.CookieClearToken(w, r)
|
||||
if api.sessions.CookieEnabled() {
|
||||
api.sessions.CookieClearToken(w, r)
|
||||
}
|
||||
|
||||
utils.HttpUnauthorized(w, err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue