summaryrefslogtreecommitdiff
path: root/internal/apimodule/auth/middleware.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-04-19 19:42:19 +0200
committerLibravatar GitHub <noreply@github.com>2021-04-19 19:42:19 +0200
commit32c5fd987a06e11b14a4247d13187657c14adedd (patch)
treef5b787ca0f020bea5fd020925e52d3592a77a6ad /internal/apimodule/auth/middleware.go
parentApi/v1/accounts (#8) (diff)
downloadgotosocial-32c5fd987a06e11b14a4247d13187657c14adedd.tar.xz
Api/v1/statuses (#11)
This PR adds: Statuses New status creation. View existing status Delete a status Fave a status Unfave a status See who's faved a status Media Upload media attachment and store/retrieve it Upload custom emoji and store/retrieve it Fileserver Serve files from storage Testing Test models, testrig -- run a GTS test instance and play around with it.
Diffstat (limited to 'internal/apimodule/auth/middleware.go')
-rw-r--r--internal/apimodule/auth/middleware.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/apimodule/auth/middleware.go b/internal/apimodule/auth/middleware.go
index 32fc24d52..4ca1f47a2 100644
--- a/internal/apimodule/auth/middleware.go
+++ b/internal/apimodule/auth/middleware.go
@@ -20,7 +20,7 @@ package auth
import (
"github.com/gin-gonic/gin"
- "github.com/superseriousbusiness/gotosocial/internal/db/model"
+ "github.com/superseriousbusiness/gotosocial/internal/db/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/oauth"
)
@@ -46,7 +46,7 @@ func (m *authModule) oauthTokenMiddleware(c *gin.Context) {
l.Tracef("authenticated user %s with bearer token, scope is %s", uid, ti.GetScope())
// fetch user's and account for this user id
- user := &model.User{}
+ user := &gtsmodel.User{}
if err := m.db.GetByID(uid, user); err != nil || user == nil {
l.Warnf("no user found for validated uid %s", uid)
return
@@ -54,7 +54,7 @@ func (m *authModule) oauthTokenMiddleware(c *gin.Context) {
c.Set(oauth.SessionAuthorizedUser, user)
l.Tracef("set gin context %s to %+v", oauth.SessionAuthorizedUser, user)
- acct := &model.Account{}
+ acct := &gtsmodel.Account{}
if err := m.db.GetByID(user.AccountID, acct); err != nil || acct == nil {
l.Warnf("no account found for validated user %s", uid)
return
@@ -66,7 +66,7 @@ func (m *authModule) oauthTokenMiddleware(c *gin.Context) {
// check for application token
if cid := ti.GetClientID(); cid != "" {
l.Tracef("authenticated client %s with bearer token, scope is %s", cid, ti.GetScope())
- app := &model.Application{}
+ app := &gtsmodel.Application{}
if err := m.db.GetWhere("client_id", cid, app); err != nil {
l.Tracef("no app found for client %s", cid)
}