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>Setup MFA - go-urlsh</title>
|
|
|
|
<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;
|
|
|
|
}
|
|
|
|
i {
|
|
|
|
font-style: normal;
|
|
|
|
margin: 15px;
|
|
|
|
}
|
|
|
|
input {
|
|
|
|
margin-top: 15px;
|
|
|
|
}
|
|
|
|
img {
|
|
|
|
margin: 15px;
|
|
|
|
}
|
|
|
|
#token {
|
|
|
|
width: 15em;
|
|
|
|
margin-right: 15px;
|
|
|
|
}
|
|
|
|
</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>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="javascript: Logout()" style="color: red;">Logout</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<main class="container" style="padding: 0">
|
|
|
|
<h1>Setup Multifactor Authentication</h1>
|
|
|
|
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/>
|
|
|
|
<i class="monospace">{{ .Key }}</i>
|
|
|
|
<br/><br/>
|
|
|
|
Afterwards please enter the passcode shown in the TOTP application here for confirmation:
|
|
|
|
<br/>
|
|
|
|
<form method="post" action="javascript:HandleMFASetupTokenSubmit();" style="width: fit-content;" autocomplete="off">
|
|
|
|
<div style="display: flex;">
|
|
|
|
<input type="text" name="token" id="token" inputmode="numeric" pattern="[0-9]{6}" autocomplete="one-time-code">
|
|
|
|
|
|
|
|
<input type="submit" value="Submit" class="contrast" style="width: fit-content;">
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<dialog id="dialog-success" style="flex-direction: column;">
|
|
|
|
<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('/admin/account')">Close</button>
|
|
|
|
</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()">Close</button>
|
|
|
|
</form>
|
|
|
|
</dialog>
|
|
|
|
</main>
|
|
|
|
{{template "partials/footer" .}}
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|