Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
idanovo committed Jul 31, 2024
1 parent 5aaa9d0 commit 436ded0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/api/auth_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ func AuthMiddleware(logger logging.Logger, swagger *openapi3.Swagger, authentica
writeError(w, r, http.StatusBadRequest, err)
return
}
_, err = checkSecurityRequirements(r, securityRequirements, logger, authenticator, authService, sessionStore, oidcConfig, cookieAuthConfig)
user, err := checkSecurityRequirements(r, securityRequirements, logger, authenticator, authService, sessionStore, oidcConfig, cookieAuthConfig)
if err != nil {
writeError(w, r, http.StatusUnauthorized, err)
return
}
if user != nil {
ctx := r.Context()
r = r.WithContext(auth.WithUser(ctx, user))
}
next.ServeHTTP(w, r)
})
}
Expand Down

0 comments on commit 436ded0

Please sign in to comment.