Enter Key for Quick Login (#513)

This commit was merged in pull request #513.
This commit is contained in:
Aditya Tawade
2026-01-15 13:33:04 +05:30
committed by GitHub
parent dc88ae5e8b
commit 8eeef84b8a

View File

@@ -376,8 +376,8 @@ export function Auth({
}; };
toast.error( toast.error(
error?.response?.data?.error || error?.response?.data?.error ||
error?.message || error?.message ||
t("errors.failedPasswordReset"), t("errors.failedPasswordReset"),
); );
} finally { } finally {
setResetLoading(false); setResetLoading(false);
@@ -936,8 +936,8 @@ export function Auth({
}} }}
> >
{theme === "dark" || {theme === "dark" ||
(theme === "system" && (theme === "system" &&
window.matchMedia("(prefers-color-scheme: dark)").matches) ? ( window.matchMedia("(prefers-color-scheme: dark)").matches) ? (
<Moon className="w-4 h-4" /> <Moon className="w-4 h-4" />
) : ( ) : (
<Sun className="w-4 h-4" /> <Sun className="w-4 h-4" />
@@ -1031,7 +1031,13 @@ export function Auth({
</div> </div>
)} )}
{!webviewAuthSuccess && totpRequired && ( {!webviewAuthSuccess && totpRequired && (
<div className="flex flex-col gap-5"> <form
className="flex flex-col gap-5"
onSubmit={(e) => {
e.preventDefault();
handleTOTPVerification();
}}
>
<div className="mb-6 text-center"> <div className="mb-6 text-center">
<h2 className="text-xl font-bold mb-1"> <h2 className="text-xl font-bold mb-1">
{t("auth.twoFactorAuth")} {t("auth.twoFactorAuth")}
@@ -1061,10 +1067,9 @@ export function Auth({
</div> </div>
<Button <Button
type="button" type="submit"
className="w-full h-11 text-base font-semibold" className="w-full h-11 text-base font-semibold"
disabled={totpLoading || totpCode.length < 6} disabled={totpLoading || totpCode.length < 6}
onClick={handleTOTPVerification}
> >
{totpLoading ? Spinner : t("auth.verifyCode")} {totpLoading ? Spinner : t("auth.verifyCode")}
</Button> </Button>
@@ -1082,7 +1087,7 @@ export function Auth({
> >
{t("common.cancel")} {t("common.cancel")}
</Button> </Button>
</div> </form>
)} )}
{!webviewAuthSuccess && {!webviewAuthSuccess &&
@@ -1492,10 +1497,10 @@ export function Auth({
}} }}
> >
{theme === "dark" || {theme === "dark" ||
(theme === "system" && (theme === "system" &&
window.matchMedia( window.matchMedia(
"(prefers-color-scheme: dark)", "(prefers-color-scheme: dark)",
).matches) ? ( ).matches) ? (
<Moon className="w-4 h-4" /> <Moon className="w-4 h-4" />
) : ( ) : (
<Sun className="w-4 h-4" /> <Sun className="w-4 h-4" />