refactor: small changes from PR review
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
07cb1ab57c
commit
82e2fbb109
2 changed files with 7 additions and 22 deletions
|
|
@ -190,8 +190,9 @@ defmodule Mv.Accounts.User do
|
|||
changeset
|
||||
|> Ash.Changeset.change_attribute(:oidc_id, oidc_id)
|
||||
# Update email if it differs from OIDC provider
|
||||
# change_attribute/3 already checks if value matches existing value
|
||||
|> then(fn cs ->
|
||||
if new_email && to_string(cs.data.email) != new_email do
|
||||
if new_email do
|
||||
Ash.Changeset.change_attribute(cs, :email, new_email)
|
||||
else
|
||||
cs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue