mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-24 06:06:20 -06:00
move tokenauth to apiutil
This commit is contained in:
parent
f734a94c1c
commit
e3857b90bb
186 changed files with 226 additions and 427 deletions
|
|
@ -24,7 +24,6 @@ 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"
|
||||
)
|
||||
|
||||
// NotificationGETHandler swagger:operation GET /api/v1/notification/{id} notification
|
||||
|
|
@ -67,7 +66,7 @@ import (
|
|||
// '500':
|
||||
// description: internal server error
|
||||
func (m *Module) NotificationGETHandler(c *gin.Context) {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ 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"
|
||||
)
|
||||
|
||||
// NotificationsClearPOSTHandler swagger:operation POST /api/v1/notifications/clear clearNotifications
|
||||
|
|
@ -58,7 +57,7 @@ import (
|
|||
// '500':
|
||||
// description: internal server error
|
||||
func (m *Module) NotificationsClearPOSTHandler(c *gin.Context) {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/paging"
|
||||
)
|
||||
|
||||
|
|
@ -143,7 +142,7 @@ import (
|
|||
// '500':
|
||||
// description: internal server error
|
||||
func (m *Module) NotificationsGETHandler(c *gin.Context) {
|
||||
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