diff options
Diffstat (limited to 'internal/api/client/admin/debug_on.go')
| -rw-r--r-- | internal/api/client/admin/debug_on.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/internal/api/client/admin/debug_on.go b/internal/api/client/admin/debug_on.go index ea42206f8..eb38e95e5 100644 --- a/internal/api/client/admin/debug_on.go +++ b/internal/api/client/admin/debug_on.go @@ -27,13 +27,15 @@ import ( "github.com/gin-gonic/gin" apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util" "github.com/superseriousbusiness/gotosocial/internal/gtserror" - "github.com/superseriousbusiness/gotosocial/internal/oauth" ) func (m *Module) DebugAPUrlHandler(c *gin.Context) { - authed, err := oauth.Authed(c, true, true, true, true) - if err != nil { - apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1) + authed, errWithCode := apiutil.TokenAuth(c, + true, true, true, true, + apiutil.ScopeAdminWrite, + ) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } @@ -58,9 +60,12 @@ func (m *Module) DebugAPUrlHandler(c *gin.Context) { } func (m *Module) DebugClearCachesHandler(c *gin.Context) { - authed, err := oauth.Authed(c, true, true, true, true) - if err != nil { - apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1) + authed, errWithCode := apiutil.TokenAuth(c, + true, true, true, true, + apiutil.ScopeAdminWrite, + ) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } |
