From 26e0b3a8464d5b78945b91817dd756759bc32ebd Mon Sep 17 00:00:00 2001
From: Matheus Martins Sarmento
Date: Fri, 3 Jun 2022 11:38:15 -0300
Subject: [PATCH] feat(2fa) add base of 2fa
---
themes/ilhasoft/login/login-config-totp.ftl | 108 ++++++++++++++++++++
themes/ilhasoft/login/login-otp.ftl | 58 +++++++++++
2 files changed, 166 insertions(+)
create mode 100755 themes/ilhasoft/login/login-config-totp.ftl
create mode 100755 themes/ilhasoft/login/login-otp.ftl
diff --git a/themes/ilhasoft/login/login-config-totp.ftl b/themes/ilhasoft/login/login-config-totp.ftl
new file mode 100755
index 0000000..8992a56
--- /dev/null
+++ b/themes/ilhasoft/login/login-config-totp.ftl
@@ -0,0 +1,108 @@
+<#import "template.ftl" as layout>
+<@layout.registrationLayout displayMessage=true; section>
+
+ <#if section = "header">
+ ${msg("loginTotpTitle")}
+ <#elseif section = "form">
+
+ -
+
${msg("loginTotpStep1")}
+
+
+ <#list totp.policy.supportedApplications as app>
+ - ${app}
+ #list>
+
+
+
+ <#if mode?? && mode = "manual">
+ -
+
${msg("loginTotpManualStep2")}
+ ${totp.totpSecretEncoded}
+ ${msg("loginTotpScanBarcode")}
+
+ -
+
${msg("loginTotpManualStep3")}
+
+
+ - ${msg("loginTotpType")}: ${msg("loginTotp." + totp.policy.type)}
+ - ${msg("loginTotpAlgorithm")}: ${totp.policy.getAlgorithmKey()}
+ - ${msg("loginTotpDigits")}: ${totp.policy.digits}
+ <#if totp.policy.type = "totp">
+ - ${msg("loginTotpInterval")}: ${totp.policy.period}
+ <#elseif totp.policy.type = "hotp">
+ - ${msg("loginTotpCounter")}: ${totp.policy.initialCounter}
+ #if>
+
+
+
+ <#else>
+
+ ${msg("loginTotpStep2")}
+
+ ${msg("loginTotpUnableToScan")}
+
+ #if>
+
+ ${msg("loginTotpStep3")}
+ ${msg("loginTotpStep3DeviceName")}
+
+
+
+
+ #if>
+@layout.registrationLayout>
\ No newline at end of file
diff --git a/themes/ilhasoft/login/login-otp.ftl b/themes/ilhasoft/login/login-otp.ftl
new file mode 100755
index 0000000..2e1054d
--- /dev/null
+++ b/themes/ilhasoft/login/login-otp.ftl
@@ -0,0 +1,58 @@
+<#import "template.ftl" as layout>
+<@layout.registrationLayout displayMessage=true; section>
+ <#if section="header">
+ ${msg("doLogIn")}
+ <#elseif section="form">
+
+ #if>
+@layout.registrationLayout>
\ No newline at end of file