Commit b1b279fbe4a368c5da6951eed8eb8686a398ee48

Thomas de Grivel 2022-01-21T16:07:44

show totp status

diff --git a/lib/kmxgit_web/templates/admin/user/index.html.heex b/lib/kmxgit_web/templates/admin/user/index.html.heex
index 0949bfe..2b1d9d3 100644
--- a/lib/kmxgit_web/templates/admin/user/index.html.heex
+++ b/lib/kmxgit_web/templates/admin/user/index.html.heex
@@ -14,6 +14,7 @@
       <th><%= gettext "Name" %></th>
       <th><%= gettext "Email" %></th>
       <th><%= gettext "Login" %></th>
+      <th><%= gettext "2FA" %></th>
       <th><%= gettext "Admin" %></th>
       <th><%= gettext "Deploy" %></th>
       <th><%= gettext "Actions" %></th>
@@ -24,6 +25,7 @@
         <td><%= link user.name, to: Routes.admin_user_path(@conn, :show, user) %></td>
         <td><%= link user.email, to: "mailto:#{user.email}" %></td>
         <td><%= link User.login(user), to: Routes.admin_user_path(@conn, :show, user) %></td>
+        <td><%= if user.totp_last != 0, do: "TOTP", else: "none" %></td>
         <td><%= user.is_admin %></td>
         <td><%= user.deploy_only %></td>
         <td><%= link gettext("Show"), to: Routes.slug_path(@conn, :show, User.login(user) || ""), class: "btn btn-sm btn-primary" %></td>
diff --git a/lib/kmxgit_web/templates/admin/user/show.html.heex b/lib/kmxgit_web/templates/admin/user/show.html.heex
index 69b06d4..44ea24a 100644
--- a/lib/kmxgit_web/templates/admin/user/show.html.heex
+++ b/lib/kmxgit_web/templates/admin/user/show.html.heex
@@ -49,6 +49,10 @@
       </td>
     </tr>
     <tr>
+      <th><%= gettext "2FA" %></th>
+      <td><%= if @user.totp_last != 0, do: "TOTP", else: "none" %></td>
+    </tr>
+    <tr>
       <th><%= gettext "Admin" %></th>
       <td><%= @user.is_admin %></td>
     </tr>