diff --git a/src/auth/pages/jwt/Login.tsx b/src/auth/pages/jwt/Login.tsx index a7824cc..bea522e 100644 --- a/src/auth/pages/jwt/Login.tsx +++ b/src/auth/pages/jwt/Login.tsx @@ -69,6 +69,12 @@ const Login = () => { setShowPassword(!showPassword); }; + const handleKeyPress = (e: { key: string }) => { + if (e.key === 'Enter') { + formik.handleSubmit(); + } + }; + return (
{ className={clsx('form-control', { 'is-invalid': formik.touched.username && formik.errors.username })} + onKeyPress={handleKeyPress} /> {formik.touched.username && formik.errors.username && ( @@ -112,6 +119,7 @@ const Login = () => { className={clsx('form-control', { 'is-invalid': formik.touched.password && formik.errors.password })} + onKeyPress={handleKeyPress} />