Add manual entry code

This commit is contained in:
Matej Bačo authored and Torsten Dittmann committed 2024-02-27 20:10:06 +01:00
1 parent 38e82bd8e3
commit c0fbd22b68
1 file changed
+39 -5
+39 -5
View File
@@ -13,6 +13,7 @@
export let showSetup = false;
export let showRecoveryCodes = false;
let copyParent: HTMLElement;
let code: string;
let type: Models.MfaType = null;
async function addAuthenticator(): Promise<URL> {
@@ -48,13 +49,43 @@
Install an authenticator app on your mobile device, open it and scan the provided QR
code or enter it manually.
</p>
<div class="qr">
{#await addAuthenticator()}
{#await addAuthenticator()}
<div class="qr">
<LoadingDots />
{:then qr}
</div>
{:then qr}
<div class="qr">
<img alt="MFA QR Code" class="code" src={qr.toString()} />
{/await}
</div>
</div>
<span class="with-separators eyebrow-heading-3">or</span>
<div>
<label class="label">Manual entry code</label>
<button class="tooltip" aria-label="sec retinfo">
<span class="icon-info" aria-hidden="true"></span>
<span class="tooltip-popup" role="tooltip">
<p class="text u-margin-block-start-8">
Manually enter the following code into the authenticator app
</p>
</span>
</button>
<div class="input-text-wrapper" style="--amount-of-buttons:1">
<input type="text" value={type.secret} readonly={true} />
<div class="options-list">
<div bind:this={copyParent}>
{#key copyParent}
<Copy value={type.secret} appendTo="parent">
<span class="icon-duplicate" aria-hidden="true" />
</Copy>
{/key}
</div>
</div>
</div>
</div>
{/await}
<hr />
<FormList>
<label for="code">Enter the 6-digit one-time code generated by the app</label>
@@ -130,6 +161,9 @@
</Modal>
<style lang="scss">
.secret {
}
.qr {
width: 100%;
height: 220px;