diff options
author | 2022-10-03 10:46:11 +0200 | |
---|---|---|
committer | 2022-10-03 10:46:11 +0200 | |
commit | 56f53a2a6f85876485e2ae67d48b78b448caed6e (patch) | |
tree | 9bd8d3fcaffd515d3dc90ff22c6cee17e8d0b073 /internal/api/client/auth/authorize.go | |
parent | [feature] Enlarge active/hovered custom emojis in statuses (#877) (diff) | |
download | gotosocial-56f53a2a6f85876485e2ae67d48b78b448caed6e.tar.xz |
[performance] add user cache and database (#879)
* go fmt
* add + use user cache and database
* fix import
* update tests
* remove unused relation
Diffstat (limited to 'internal/api/client/auth/authorize.go')
-rw-r--r-- | internal/api/client/auth/authorize.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/api/client/auth/authorize.go b/internal/api/client/auth/authorize.go index 83cddd9b5..b345f9b01 100644 --- a/internal/api/client/auth/authorize.go +++ b/internal/api/client/auth/authorize.go @@ -94,8 +94,8 @@ func (m *Module) AuthorizeGETHandler(c *gin.Context) { return } - user := >smodel.User{} - if err := m.db.GetByID(c.Request.Context(), userID, user); err != nil { + user, err := m.db.GetUserByID(c.Request.Context(), userID) + if err != nil { m.clearSession(s) safe := fmt.Sprintf("user with id %s could not be retrieved", userID) var errWithCode gtserror.WithCode @@ -213,8 +213,8 @@ func (m *Module) AuthorizePOSTHandler(c *gin.Context) { return } - user := >smodel.User{} - if err := m.db.GetByID(c.Request.Context(), userID, user); err != nil { + user, err := m.db.GetUserByID(c.Request.Context(), userID) + if err != nil { m.clearSession(s) safe := fmt.Sprintf("user with id %s could not be retrieved", userID) var errWithCode gtserror.WithCode |