From fdfd372feb039b5dee16c40aa49e50aeaf685809 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Tue, 13 Aug 2024 21:12:17 +0900
Subject: feat: disallow login with email address

---
 frontend/app/routes/login.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'frontend/app/routes/login.tsx')

diff --git a/frontend/app/routes/login.tsx b/frontend/app/routes/login.tsx
index b1249e0..6d76e84 100644
--- a/frontend/app/routes/login.tsx
+++ b/frontend/app/routes/login.tsx
@@ -35,6 +35,18 @@ export async function action({ request }: ActionFunctionArgs) {
 			{ status: 400 },
 		);
 	}
+	if (username.includes("@")) {
+		return json(
+			{
+				message: "ユーザー名が誤っています",
+				errors: {
+					username: "メールアドレスではなくユーザー名を入力してください",
+					password: undefined,
+				},
+			},
+			{ status: 400 },
+		);
+	}
 
 	try {
 		await login(request);
-- 
cgit v1.2.3-70-g09d2

