Skip to content

Commit

Permalink
Merge branch 'email_2fa_conditions' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyranthes03 committed Jan 30, 2025
2 parents 4a5bf85 + db6a563 commit 8214346
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ defmodule RecognizerWeb.Accounts.UserSettingsController do
|> put_flash(:error, "Two factor code is invalid")
|> redirect(to: Routes.user_settings_path(conn, :two_factor_confirm))
else
# invalid code
if Authentication.valid_token?(method_atom, two_factor_code, two_factor_issue_time, updated_user) do
Accounts.clear_two_factor_settings(updated_user)

Expand All @@ -189,6 +190,10 @@ defmodule RecognizerWeb.Accounts.UserSettingsController do
|> put_session(:two_factor_issue_time, nil)
|> put_flash(:info, "Two factor code verified")
|> redirect(to: Routes.user_settings_path(conn, :edit))
else
conn
|> put_flash(:error, "Two factor code is invalid")
|> redirect(to: Routes.user_settings_path(conn, :two_factor_confirm))
end
end
end
Expand Down

0 comments on commit 8214346

Please sign in to comment.