mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-24 09:26:14 -06:00
move tokenauth to apiutil
This commit is contained in:
parent
f734a94c1c
commit
e3857b90bb
186 changed files with 226 additions and 427 deletions
|
|
@ -29,7 +29,6 @@ import (
|
|||
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
type singleDomainPermCreate func(
|
||||
|
|
@ -63,7 +62,7 @@ func (m *Module) createDomainPermissions(
|
|||
single singleDomainPermCreate,
|
||||
multi multiDomainPermCreate,
|
||||
) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
authed, err := apiutil.TokenAuth(c, true, true, true, true)
|
||||
if err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
|
|
@ -171,7 +170,7 @@ func (m *Module) deleteDomainPermission(
|
|||
c *gin.Context,
|
||||
permType gtsmodel.DomainPermissionType, // block/allow
|
||||
) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
authed, err := apiutil.TokenAuth(c, true, true, true, true)
|
||||
if err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
|
|
@ -218,7 +217,7 @@ func (m *Module) getDomainPermission(
|
|||
c *gin.Context,
|
||||
permType gtsmodel.DomainPermissionType,
|
||||
) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
authed, err := apiutil.TokenAuth(c, true, true, true, true)
|
||||
if err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
|
|
@ -266,7 +265,7 @@ func (m *Module) getDomainPermissions(
|
|||
c *gin.Context,
|
||||
permType gtsmodel.DomainPermissionType,
|
||||
) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
authed, err := apiutil.TokenAuth(c, true, true, true, true)
|
||||
if err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue