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/processing/user/emailconfirm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/processing/user/emailconfirm.go') diff --git a/internal/processing/user/emailconfirm.go b/internal/processing/user/emailconfirm.go index 6bffce7d9..5a68383b8 100644 --- a/internal/processing/user/emailconfirm.go +++ b/internal/processing/user/emailconfirm.go @@ -89,8 +89,8 @@ func (p *processor) ConfirmEmail(ctx context.Context, token string) (*gtsmodel.U return nil, gtserror.NewErrorNotFound(errors.New("no token provided")) } - user := >smodel.User{} - if err := p.db.GetWhere(ctx, []db.Where{{Key: "confirmation_token", Value: token}}, user); err != nil { + user, err := p.db.GetUserByConfirmationToken(ctx, token) + if err != nil { if err == db.ErrNoEntries { return nil, gtserror.NewErrorNotFound(err) } -- cgit v1.2.3