diff --git a/lib/philomena_web/controllers/registration/totp_controller.ex b/lib/philomena_web/controllers/registration/totp_controller.ex index 3237ec75..3cea3279 100644 --- a/lib/philomena_web/controllers/registration/totp_controller.ex +++ b/lib/philomena_web/controllers/registration/totp_controller.ex @@ -47,9 +47,9 @@ defmodule PhilomenaWeb.Registration.TotpController do {:ok, user} -> conn - |> UserAuth.totp_auth_user(user, %{}) |> put_flash(:totp_backup_codes, backup_codes) - |> redirect(to: Routes.registration_totp_path(conn, :edit)) + |> put_session(:user_return_to, Routes.registration_totp_path(conn, :edit)) + |> UserAuth.totp_auth_user(user, %{}) end end end