Skip to content

Commit 896456a

Browse files
morphelinhotechknowlogick
authored andcommitted
Fix 405 method not allowed CORS / OIDC (go-gitea#28583)
Follow go-gitea#28184 Follow go-gitea#28515 Fix problem with 405 method not allowed for CORS wrt OIDC
1 parent 1b26247 commit 896456a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

routers/web/web.go

+2
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,11 @@ func registerRoutes(m *web.Route) {
532532
// TODO manage redirection
533533
m.Post("/authorize", web.Bind(forms.AuthorizationForm{}), auth.AuthorizeOAuth)
534534
}, ignSignInAndCsrf, reqSignIn)
535+
m.Options("/login/oauth/userinfo", CorsHandler(), misc.DummyBadRequest)
535536
m.Get("/login/oauth/userinfo", ignSignInAndCsrf, auth.InfoOAuth)
536537
m.Options("/login/oauth/access_token", CorsHandler(), misc.DummyBadRequest)
537538
m.Post("/login/oauth/access_token", CorsHandler(), web.Bind(forms.AccessTokenForm{}), ignSignInAndCsrf, auth.AccessTokenOAuth)
539+
m.Options("/login/oauth/keys", CorsHandler(), misc.DummyBadRequest)
538540
m.Get("/login/oauth/keys", ignSignInAndCsrf, auth.OIDCKeys)
539541
m.Options("/login/oauth/introspect", CorsHandler(), misc.DummyBadRequest)
540542
m.Post("/login/oauth/introspect", CorsHandler(), web.Bind(forms.IntrospectTokenForm{}), ignSignInAndCsrf, auth.IntrospectOAuth)

0 commit comments

Comments
 (0)