go-urlsh/views/setup-multifactor.tmpl

110 lines
3.1 KiB
Cheetah
Raw Permalink Normal View History

2024-05-04 17:06:01 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Set up Two-Factor authentication - go-urlsh</title>
2024-05-04 17:06:01 +02:00
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel="stylesheet" href="/admin/pico.min.css">
2024-05-09 14:00:52 +02:00
<link rel="stylesheet" href="/admin/pico.colors.min.css">
2024-05-04 17:06:01 +02:00
<link rel="stylesheet" href="/admin/custom.css">
<script src="/admin/main.js" defer></script>
<style>
h1,
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 30px;
2024-05-04 17:06:01 +02:00
}
2024-05-04 17:06:01 +02:00
i {
font-style: normal;
margin: 15px;
}
2024-05-04 17:06:01 +02:00
input {
margin-top: 15px;
}
2024-05-04 17:06:01 +02:00
img {
margin: 15px;
}
2024-05-04 17:06:01 +02:00
#token {
width: 15em;
margin-right: 15px;
}
.hidden {
display: none;
}
2024-05-04 17:06:01 +02:00
</style>
</head>
<body>
<nav class="container-fluid">
<ul>
<li>
<a href="/admin/" class="contrast"><strong>go-urlsh</strong></a>
</li>
</ul>
<ul>
<li>
<a href="/admin/">Links</a>
</li>
<li>
<a href="/admin/apikeys/">API Keys</a>
</li>
<li>
<a href="javascript: void(0)">Users (coming soon)</a>
2024-05-04 17:06:01 +02:00
</li>
<li>
<a href="javascript: Logout()" style="color: red;">Logout</a>
</li>
</ul>
</nav>
<main class="container" style="padding: 0">
<h1>Setup Two-Factor authentication</h1>
In order to setup Two-Factor authentication, please scan this image with your authentication application:<br />
<img src="data:image/png;base64,{{ .Image }}" alt="TOTP QR-Code" width="200" height="200"><br />
Or enter the secret manually into your TOTP application:
<br />
2024-05-04 17:06:01 +02:00
<i class="monospace">{{ .Key }}</i>
<br /><br />
2024-05-04 17:06:01 +02:00
Afterwards please enter the passcode shown in the TOTP application here for confirmation:
<br />
<form action="javascript:HandleMFASetupTokenSubmit();" style="width: fit-content;" autocomplete="off">
<p id="error-message" class="hidden" style="color: var(--pico-color-red-500)">
The TOTP code you provided is not correct. Please try again</p>
2024-05-04 17:06:01 +02:00
<div style="display: flex;">
<input type="text" name="token" id="token" inputmode="numeric" autocomplete="one-time-code">
2024-05-04 17:06:01 +02:00
<input id="button-submit" type="submit" value="Submit" class="contrast" style="width: fit-content;">
2024-05-04 17:06:01 +02:00
</div>
</form>
<dialog id="user-dialog" style="flex-direction: column;">
2024-05-04 17:06:01 +02:00
<h2 id="dialog-heading">2FA successfully set up!</h2>
<p id="dialog-text">These are your recovery codes, keep them somewhere safe, you'll only see them once:</p>
<p id="dialog-tokens" class="monospace"></p>
<form method="dialog">
<button onclick="HandleModalClose('user-dialog', '/admin/account')">Close</button>
2024-05-04 17:06:01 +02:00
</form>
</dialog>
<dialog id="dialog-error" style="flex-direction: column;">
<h2 id="dialog-heading"></h2>
<p id="dialog-text"></p>
<form method="dialog">
<button onclick="HandleModalClose('dialog-error')">Close</button>
2024-05-04 17:06:01 +02:00
</form>
</dialog>
</main>
{{template "partials/footer" .}}
</body>
</html>