diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-20 21:12:23 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-20 21:21:45 +1000 |
commit | c07950570c8b6a4c12ebf431fabea646286834ca (patch) | |
tree | 381867f2895cf23ef4e00b77e7a6365d83a9655a /slowcord/login/public/js | |
parent | Merge branch 'feat/latestWebClient' into slowcord (diff) | |
download | server-c07950570c8b6a4c12ebf431fabea646286834ca.tar.xz |
2FA on login page
Diffstat (limited to 'slowcord/login/public/js')
-rw-r--r-- | slowcord/login/public/js/handler.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/slowcord/login/public/js/handler.js b/slowcord/login/public/js/handler.js index aabc7a4c..68a656b4 100644 --- a/slowcord/login/public/js/handler.js +++ b/slowcord/login/public/js/handler.js @@ -16,6 +16,18 @@ const handleSubmit = async (path, body) => { return; } + if (json.ticket) { + // my terrible solution to 2fa + const twoFactorForm = document.forms["2fa"]; + const loginForm = document.forms["login"]; + + twoFactorForm.style.display = "flex"; + loginForm.style.display = "none"; + + twoFactorForm.ticket.value = json.ticket; + return; + } + // Very fun error message here lol const error = json.errors |