mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-10 07:50:37 -07:00
fix: invalid json response when login gate is disabled
This commit is contained in:
parent
42b32c7920
commit
2356e75a3b
2 changed files with 16 additions and 4 deletions
|
|
@ -62,6 +62,7 @@ func Authenticate(store db.DB, mode AuthMode) func(http.Handler) http.Handler {
|
|||
}
|
||||
} else {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -76,10 +77,8 @@ func Authenticate(store db.DB, mode AuthMode) func(http.Handler) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
if user != nil {
|
||||
ctx = context.WithValue(ctx, UserContextKey, user)
|
||||
r = r.WithContext(ctx)
|
||||
}
|
||||
ctx = context.WithValue(ctx, UserContextKey, user)
|
||||
r = r.WithContext(ctx)
|
||||
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue