From 3a5b95312f2acb114342d2ca1bfd5d4e0f5d4925 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 15 Nov 2020 21:07:55 -0500 Subject: [PATCH] reorder TOTP redirect (fixes philomena-dev/philomena#62) --- lib/philomena_web/controllers/registration/totp_controller.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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