mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 16:58:31 +02:00
fix: json store marshaling, api handler
- code clean up - uncomment and simplify api auth handler - fix redirect url for frontend - proper redirect
This commit is contained in:
@@ -72,18 +72,13 @@ func (amw *oidcMiddleware) before(w http.ResponseWriter, r *http.Request) (proce
|
||||
return false
|
||||
}
|
||||
|
||||
if r.URL.Path == auth.OIDCLogoutPath {
|
||||
amw.auth.LogoutHandler(w, r)
|
||||
return false
|
||||
}
|
||||
|
||||
err := amw.auth.CheckToken(r)
|
||||
if err == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
switch {
|
||||
case errors.Is(err, auth.ErrMissingToken):
|
||||
case errors.Is(err, auth.ErrMissingOAuthToken):
|
||||
amw.auth.HandleAuth(w, r)
|
||||
default:
|
||||
auth.WriteBlockPage(w, http.StatusForbidden, err.Error(), auth.OIDCLogoutPath)
|
||||
|
||||
Reference in New Issue
Block a user