Skip to content

Commit e7b44ee

Browse files
committed
chore: small ui fixes
1 parent ea21cbd commit e7b44ee

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

frontend/src/components/auth/totp-form.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ export const TotpForm = (props: Props) => {
2626

2727
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
2828
const value = e.target.value.replace(/\D/g, "").slice(0, 6);
29-
form.setValue("code", value, { shouldDirty: true, shouldValidate: true });
29+
form.setValue("code", value, { shouldDirty: true, shouldValidate: false });
3030
if (value.length === 6) {
3131
form.handleSubmit(onSubmit)();
3232
}
3333
};
3434

35+
// Note: This is not the best UX, ideally we would want https://github.com/guilhermerodz/input-otp
36+
// but some password managers cannot autofill the inputs (see #92) so, simple input it is
3537
return (
3638
<Form {...form}>
3739
<form id={formId} onSubmit={form.handleSubmit(onSubmit)}>
@@ -43,8 +45,6 @@ export const TotpForm = (props: Props) => {
4345
<FormControl>
4446
<Input
4547
{...field}
46-
id="totp-code"
47-
name="code"
4848
type="text"
4949
inputMode="numeric"
5050
autoComplete="one-time-code"

frontend/src/pages/totp-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const TotpPage = () => {
7474
<CardTitle className="text-xl">{t("totpTitle")}</CardTitle>
7575
<CardDescription>{t("totpSubtitle")}</CardDescription>
7676
</CardHeader>
77-
<CardContent className="flex flex-col items-center">
77+
<CardContent>
7878
<TotpForm
7979
formId={formId}
8080
onSubmit={(values) => totpMutation.mutate(values)}

0 commit comments

Comments
 (0)