Commit 2c9744f1c71d0a021c83cd8e6653514e58fc3335

Thomas de Grivel 2022-02-03T15:29:41

fix totp enrolment

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/lib/kmxgit/user_manager/user.ex b/lib/kmxgit/user_manager/user.ex
index d327d34..78910f5 100644
--- a/lib/kmxgit/user_manager/user.ex
+++ b/lib/kmxgit/user_manager/user.ex
@@ -263,8 +263,8 @@ defmodule Kmxgit.UserManager.User do
   end
 
   defp verify_totp_last(changeset) do
-    otp_last = changeset |> get_field(:otp_last) |> Integer.to_string()
-    if totp_verify(changeset.data, otp_last) do
+    totp_last = changeset |> get_field(:totp_last) |> Integer.to_string()
+    if totp_verify(changeset.data, totp_last) do
       changeset
     else
       changeset