Clean access priority

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-08-04 18:35:27 +02:00
parent 5fb0b9cffc
commit 2355a69f6d

View File

@@ -167,14 +167,14 @@ func WithSession(usrmgrSvc *usrmgr.Service, trustSvc *trust.Service, authCfg Aut
return func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
if authCtx := trySessionAuth(ctx, w, r, usrmgrSvc, authCfg); authCtx != nil {
if authCtx := tryTokenAuth(ctx, w, r, trustSvc, authCfg); authCtx != nil {
next(w, r.WithContext(authCtx))
updateSessionIfNeeded(authCtx, usrmgrSvc)
return
}
if authCtx := tryTokenAuth(ctx, w, r, trustSvc, authCfg); authCtx != nil {
if authCtx := trySessionAuth(ctx, w, r, usrmgrSvc, authCfg); authCtx != nil {
next(w, r.WithContext(authCtx))
updateSessionIfNeeded(authCtx, usrmgrSvc)
return
}