mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
Feature/oauth userinfo (#15721)
* Implemented userinfo #8534 * Make lint happy * Add userinfo endpoint to openid-configuration * Give an error when uid equals 0 * Implemented BearerTokenErrorCode handling * instead of ctx.error use ctx.json so that clients parse error and error_description correctly * Removed unneeded if statement * Use switch instead of subsequent if statements Have a default for unknown errorcodes. Co-authored-by: Nils Hillmann <hillmann@nlh-software.de> Co-authored-by: nlhsoftware <nlhsoftware@noreply.localhost>
This commit is contained in:
@@ -410,6 +410,7 @@ func RegisterRoutes(m *web.Route) {
|
||||
// TODO manage redirection
|
||||
m.Post("/authorize", bindIgnErr(forms.AuthorizationForm{}), user.AuthorizeOAuth)
|
||||
}, ignSignInAndCsrf, reqSignIn)
|
||||
m.Get("/login/oauth/userinfo", ignSignInAndCsrf, user.InfoOAuth)
|
||||
if setting.CORSConfig.Enabled {
|
||||
m.Post("/login/oauth/access_token", cors.Handler(cors.Options{
|
||||
//Scheme: setting.CORSConfig.Scheme, // FIXME: the cors middleware needs scheme option
|
||||
|
Reference in New Issue
Block a user