fix(users): Fix bugs caused by the new token only flows (#4607)

This commit is contained in:
Mani Chandra
2024-05-09 19:39:02 +05:30
committed by GitHub
parent c0bb117f24
commit a0f11d79ad
3 changed files with 34 additions and 8 deletions

View File

@ -1445,9 +1445,13 @@ pub async fn verify_email_token_only_flow(
.change_context(UserErrors::InternalServerError)?
.into();
let _ = auth::blacklist::insert_email_token_in_blacklist(&state, &token)
.await
.map_err(|e| logger::error!(?e));
if matches!(user_token.origin, domain::Origin::VerifyEmail)
|| matches!(user_token.origin, domain::Origin::MagicLink)
{
let _ = auth::blacklist::insert_email_token_in_blacklist(&state, &token)
.await
.map_err(|e| logger::error!(?e));
}
let current_flow =
domain::CurrentFlow::new(user_token.origin, domain::SPTFlow::VerifyEmail.into())?;