0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-19 15:00:52 +02:00

Add PUT endpoint for creating new OAuth2 authentication and clean up routing

This commit is contained in:
Tim Riedl 2025-04-19 01:47:57 +02:00
parent 25425adf29
commit 62dc4c2da3
No known key found for this signature in database
GPG Key ID: 172D6410FC4F844E
2 changed files with 3 additions and 2 deletions

View File

@ -26,6 +26,7 @@ import (
func CreateOauthAuth(ctx *context.APIContext) { func CreateOauthAuth(ctx *context.APIContext) {
form := web.GetForm(ctx).(*api.CreateAuthOauth2Option) form := web.GetForm(ctx).(*api.CreateAuthOauth2Option)
// ??? todo: what should I do here?
var scopes []string var scopes []string
// for _, s := range strings.Split(form.Oauth2Scopes, ",") { // for _, s := range strings.Split(form.Oauth2Scopes, ",") {
// s = strings.TrimSpace(s) // s = strings.TrimSpace(s)

View File

@ -1650,10 +1650,10 @@ func Routes() *web.Router {
m.Group("/admin", func() { m.Group("/admin", func() {
m.Group("/identity-auth", func() { m.Group("/identity-auth", func() {
m.Group("oauth", func() { m.Group("/oauth", func() {
m.Get("", admin.SearchOauthAuth) m.Get("", admin.SearchOauthAuth)
m.Put("/new", bind(api.CreateAuthOauth2Option{}), admin.CreateOauthAuth)
m.Delete("/{id}", admin.DeleteOauthAuth) m.Delete("/{id}", admin.DeleteOauthAuth)
m.Post("/new", admin.CreateOauthAuth)
}) })
}) })