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:
parent
25425adf29
commit
62dc4c2da3
@ -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)
|
||||||
|
@ -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)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user