From f204fb4c9b34ce12af1be2e2be4e0d9079329953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 7 Apr 2022 21:04:54 +0200 Subject: [PATCH 1/2] fix(core\pages\signin.tsx): set type of built-in email sign-in input to email for browse validation Currently, the built-in sign-in page has the wrong type (text) for the input for emails when using the magic link provider. Because of this a user can enter whatever they want in that input. By switching the type to be email we can make use of the browser provided validation and users will be forced to use properly formed emails addresses in order to sign-in. --- packages/next-auth/src/core/pages/signin.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-auth/src/core/pages/signin.tsx b/packages/next-auth/src/core/pages/signin.tsx index acd89475a5..5cc8fff159 100644 --- a/packages/next-auth/src/core/pages/signin.tsx +++ b/packages/next-auth/src/core/pages/signin.tsx @@ -123,7 +123,7 @@ export default function SigninPage(props: SignInServerPageParams) { Date: Sat, 9 Apr 2022 14:16:32 +0200 Subject: [PATCH 2/2] fix(core\pages\signin.tsx): add required attribute to built-in sign-in email input Currently, the built-in sign-in page doesn't have the required attribute for the input for emails when using the magic link provider. Because of this a user is able to submit the form without entering a value. By adding the "required" attribute we can make use of the browser provided validation and users will be forced to provide a value in order to sign-in. --- packages/next-auth/src/core/pages/signin.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next-auth/src/core/pages/signin.tsx b/packages/next-auth/src/core/pages/signin.tsx index 5cc8fff159..1c61e69fd9 100644 --- a/packages/next-auth/src/core/pages/signin.tsx +++ b/packages/next-auth/src/core/pages/signin.tsx @@ -127,6 +127,7 @@ export default function SigninPage(props: SignInServerPageParams) { name="email" value={email} placeholder="email@example.com" + required />