From 56f53a2a6f85876485e2ae67d48b78b448caed6e Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:46:11 +0200 Subject: [performance] add user cache and database (#879) * go fmt * add + use user cache and database * fix import * update tests * remove unused relation --- internal/api/client/auth/callback.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'internal/api/client/auth/callback.go') diff --git a/internal/api/client/auth/callback.go b/internal/api/client/auth/callback.go index 96a73a52f..daee2ae31 100644 --- a/internal/api/client/auth/callback.go +++ b/internal/api/client/auth/callback.go @@ -134,8 +134,7 @@ func (m *Module) parseUserFromClaims(ctx context.Context, claims *oidc.Claims, i // see if we already have a user for this email address // if so, we don't need to continue + create one - user := >smodel.User{} - err := m.db.GetWhere(ctx, []db.Where{{Key: "email", Value: claims.Email}}, user) + user, err := m.db.GetUserByEmailAddress(ctx, claims.Email) if err == nil { return user, nil } -- cgit v1.2.3