Skip to content

Commit

Permalink
chore: update email after verified
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleSamtoshi committed Feb 16, 2024
1 parent a23571d commit ea6bdbf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/api/src/app/authentication/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export const addEmailToIdentity = async ({
const emailRegistrationId = await authServiceEmail.sendEmailWithCode({ email })
if (emailRegistrationId instanceof Error) return emailRegistrationId

await NotificationsService().updateEmailAddress({ userId, email })

const user = await UsersRepository().findById(userId)
if (user instanceof Error) return user

Expand All @@ -50,6 +48,11 @@ export const verifyEmail = async ({
})
if (res instanceof Error) return res

await NotificationsService().updateEmailAddress({
userId: res.kratosUserId,
email: res.email,
})

const user = await UsersRepository().findById(res.kratosUserId)
if (user instanceof Error) return user

Expand Down

0 comments on commit ea6bdbf

Please sign in to comment.