Skip to content

Commit dd2f43f

Browse files
committed
email address should not be case sensitive for new sign in system
1 parent 169a6d1 commit dd2f43f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/packages/next/components/auth/sign-up.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ export default function SignUp({ strategies }) {
205205
function EmailOrSSO({ email, setEmail, signUp, strategies }) {
206206
return (
207207
<div>
208-
<p>{strategies.length > 0 ? "Sign up using either your email address or a single sign on provider." : "Enter the email address you will use to sign in."}</p>
208+
<p>
209+
{strategies.length > 0
210+
? "Sign up using either your email address or a single sign on provider."
211+
: "Enter the email address you will use to sign in."}
212+
</p>
209213
<p>
210214
<Input
211215
style={{ fontSize: "12pt" }}

src/packages/next/pages/api/v2/auth/sign-in.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ import Cookies from "cookies";
2727

2828
export default async function signIn(req, res) {
2929
if (req.method === "POST") {
30-
const { email, password } = req.body;
30+
let { email, password } = req.body;
31+
email = email.toLowerCase().trim();
3132
const check = signInCheck(email, req.ip);
3233
if (check) {
3334
res.json({ error: check });

src/packages/next/pages/api/v2/auth/sign-up.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ interface Issues {
3434

3535
export default async function signUp(req, res) {
3636
if (req.method === "POST") {
37-
const { email, password, firstName, lastName } = req.body;
37+
let { email, password, firstName, lastName } = req.body;
38+
password = password.trim();
39+
email = email.toLowerCase().trim();
40+
firstName = firstName.trim();
41+
lastName = lastName.trim();
3842

3943
try {
4044
const account_id = await getAccount(email, password);

0 commit comments

Comments
 (0)