Skip to content

Commit 62dc4c2

Browse files
committed
Add PUT endpoint for creating new OAuth2 authentication and clean up routing
1 parent 25425ad commit 62dc4c2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

routers/api/v1/admin/auth_oauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
func CreateOauthAuth(ctx *context.APIContext) {
2727
form := web.GetForm(ctx).(*api.CreateAuthOauth2Option)
2828

29+
// ??? todo: what should I do here?
2930
var scopes []string
3031
// for _, s := range strings.Split(form.Oauth2Scopes, ",") {
3132
// s = strings.TrimSpace(s)

routers/api/v1/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,10 +1650,10 @@ func Routes() *web.Router {
16501650

16511651
m.Group("/admin", func() {
16521652
m.Group("/identity-auth", func() {
1653-
m.Group("oauth", func() {
1653+
m.Group("/oauth", func() {
16541654
m.Get("", admin.SearchOauthAuth)
1655+
m.Put("/new", bind(api.CreateAuthOauth2Option{}), admin.CreateOauthAuth)
16551656
m.Delete("/{id}", admin.DeleteOauthAuth)
1656-
m.Post("/new", admin.CreateOauthAuth)
16571657
})
16581658
})
16591659

0 commit comments

Comments
 (0)