From d839f27c306eedebdc7cc0311f35b8856cc2bb24 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 21 May 2021 15:48:26 +0200 Subject: Follows and relationships (#27) * Follows -- create and undo, both remote and local * Statuses -- federate new posts, including media, attachments, CWs and image descriptions. --- internal/api/client/auth/middleware.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/api/client/auth/middleware.go') diff --git a/internal/api/client/auth/middleware.go b/internal/api/client/auth/middleware.go index 2a63cbdb6..dba8e5a1d 100644 --- a/internal/api/client/auth/middleware.go +++ b/internal/api/client/auth/middleware.go @@ -20,6 +20,7 @@ package auth import ( "github.com/gin-gonic/gin" + "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/oauth" ) @@ -68,7 +69,7 @@ func (m *Module) OauthTokenMiddleware(c *gin.Context) { if cid := ti.GetClientID(); cid != "" { l.Tracef("authenticated client %s with bearer token, scope is %s", cid, ti.GetScope()) app := >smodel.Application{} - if err := m.db.GetWhere("client_id", cid, app); err != nil { + if err := m.db.GetWhere([]db.Where{{Key: "client_id",Value: cid}}, app); err != nil { l.Tracef("no app found for client %s", cid) } c.Set(oauth.SessionAuthorizedApplication, app) -- cgit v1.2.3