Skip to content

Commit

Permalink
feat: Disable CSRF check for "/c/oidc/onboard" API for authenticating…
Browse files Browse the repository at this point in the history
… and Onboarding a User via API from Custom CLI

Closes #16966
Fixes #16966

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
  • Loading branch information
Rajpratik71 committed Jun 9, 2022
1 parent b8a71ac commit 0573f59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/server/middleware/csrf/csrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func csrfSkipper(req *http.Request) bool {
if (strings.HasPrefix(path, "/v2/") ||
strings.HasPrefix(path, "/api/") ||
strings.HasPrefix(path, "/chartrepo/") ||
strings.HasPrefix(path, "/c/oidc/onboard") ||
strings.HasPrefix(path, "/service/")) && !lib.GetCarrySession(req.Context()) {
return true
}
Expand Down

0 comments on commit 0573f59

Please sign in to comment.