Skip to content

Commit 7153189

Browse files
committed
fix: TOTP-specific OTP screen issues in AuthorizerVerifyOtp
- Hide "Resend OTP" when is_totp is true: TOTP codes are generated locally by an authenticator app on a 30s rolling window, never sent by the server, so offering to resend was misleading and the backend call for it doesn't apply to this flow. - Add autocomplete="one-time-code" to the OTP input so browsers/OS can offer native autofill for authenticator/SMS codes.
1 parent a6a4618 commit 7153189

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/components/AuthorizerVerifyOtp.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export const AuthorizerVerifyOtp: FC<{
161161
}`}
162162
placeholder="e.g.- AB123C"
163163
type="password"
164+
autoComplete="one-time-code"
164165
value={formData.otp || ''}
165166
onChange={(e) => onInputChange('otp', e.target.value)}
166167
disabled={isLockedOut}
@@ -189,13 +190,14 @@ export const AuthorizerVerifyOtp: FC<{
189190
</form>
190191
{setView && (
191192
<StyledFooter>
192-
{sendingOtp ? (
193-
<div style={{ marginBottom: '10px' }}>Sending ...</div>
194-
) : (
195-
<StyledLink onClick={resendOtp} marginBottom="10px">
196-
Resend OTP
197-
</StyledLink>
198-
)}
193+
{!is_totp &&
194+
(sendingOtp ? (
195+
<div style={{ marginBottom: '10px' }}>Sending ...</div>
196+
) : (
197+
<StyledLink onClick={resendOtp} marginBottom="10px">
198+
Resend OTP
199+
</StyledLink>
200+
))}
199201
{config.is_sign_up_enabled && (
200202
<div>
201203
Don't have an account?{' '}

0 commit comments

Comments
 (0)