[v11.0.x] User: email verification completion (#86354)

User: email verification completion (#85259)

* TempUser: Include InvitedById in TempUserDTO

* Extract email verfication completion flow to service

(cherry picked from commit 73e426b081)

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-16 16:24:53 +01:00
committed by GitHub
co-authored by Karl Persson
parent 23a24bc9af
commit 64c17b0ee6
11 changed files with 275 additions and 108 deletions
+8 -1
View File
@@ -315,7 +315,14 @@ func (ss *sqlStore) Update(ctx context.Context, cmd *user.UpdateUserCommand) err
Updated: time.Now(),
}
if _, err := sess.ID(cmd.UserID).Where(ss.notServiceAccountFilter()).Update(&user); err != nil {
q := sess.ID(cmd.UserID).Where(ss.notServiceAccountFilter())
if cmd.EmailVerified != nil {
q.UseBool("email_verified")
user.EmailVerified = *cmd.EmailVerified
}
if _, err := q.Update(&user); err != nil {
return err
}