Skip to content

Commit 7a5cb9b

Browse files
committed
fix: fix 2fa modal TOTP input scaling from rem
1 parent dc3c142 commit 7a5cb9b

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

custom/TwoFAModal.vue

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
<template>
22
<div class="af-two-factors-modal fixed inset-0 z-[9999] flex items-center justify-center bg-black/50 top-0 bottom-0 left-0 right-0"
33
v-show ="modelShow && (isLoading === false)">
4-
<div v-if="modalMode === 'totp'" class="af-two-factor-modal-totp relative bg-white dark:bg-gray-700 rounded-lg shadow p-6 w-full max-w-md">
4+
<div v-if="modalMode === 'totp'" class="af-two-factor-modal-totp flex flex-col items-center relative bg-white dark:bg-gray-700 rounded-lg shadow p-6 w-full max-w-md">
55
<div id="mfaCode-label" class="mb-4 text-gray-700 dark:text-gray-100 text-center">
66
<p> {{ customDialogTitle }} </p>
77
<p>{{ $t('Please enter your authenticator code') }}</p>
88
</div>
9-
10-
<div class="my-4 w-full flex justify-center" ref="otpRoot">
11-
<v-otp-input
12-
ref="confirmationResult"
13-
container-class="grid grid-cols-6 gap-3 w-full"
14-
input-classes="bg-gray-50 text-center flex justify-center otp-input border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-10 h-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
15-
:num-inputs="6"
16-
inputType="number"
17-
inputmode="numeric"
18-
:should-auto-focus="true"
19-
:should-focus-order="true"
20-
v-model:value="bindValue"
21-
@on-complete="handleOnComplete"
22-
/>
23-
</div>
24-
25-
<div class="mt-6 flex justify-center items-center gap-32 w-full">
26-
<p v-if="doesUserHavePasskeys===true" class="underline hover:no-underline text-lightPrimary whitespace-nowrap hover:cursor-pointer" @click="modalMode = 'passkey'" >{{$t('use passkey')}}</p>
27-
<Button
28-
class="px-4 py-2 rounded border"
29-
@click="onCancel"
30-
:disabled="inProgress"
31-
>{{ $t('Cancel') }}</Button>
9+
10+
<div class="flex flex-col max-w-[calc(15rem_+_60px)]">
11+
<div class="mb-4 w-full flex justify-center" ref="otpRoot">
12+
<v-otp-input
13+
ref="confirmationResult"
14+
container-class="grid grid-cols-6 gap-3 w-full"
15+
input-classes="bg-gray-50 text-center flex justify-center otp-input border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-10 h-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
16+
:num-inputs="6"
17+
inputType="number"
18+
inputmode="numeric"
19+
:should-auto-focus="true"
20+
:should-focus-order="true"
21+
v-model:value="bindValue"
22+
@on-complete="handleOnComplete"
23+
/>
24+
</div>
25+
26+
<div class="flex justify-between items-center gap-32 w-full">
27+
<p v-if="doesUserHavePasskeys===true" class="underline hover:no-underline text-lightPrimary whitespace-nowrap hover:cursor-pointer" @click="modalMode = 'passkey'" >{{$t('use passkey')}}</p>
28+
<Button
29+
class="px-4 py-2 rounded border"
30+
@click="onCancel"
31+
:disabled="inProgress"
32+
>{{ $t('Cancel') }}</Button>
33+
</div>
3234
</div>
3335
</div>
3436

0 commit comments

Comments
 (0)