mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Add manual entry code
This commit is contained in:
1 parent
38e82bd8e3
commit
c0fbd22b68
1 file changed
+39
-5
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user