Skip to content

Commit ad5a1db

Browse files
committed
๐Ÿ› fix: ๋กœ๊ทธ์ธ ์—๋Ÿฌ์ฒ˜๋ฆฌ ์ˆ˜์ •
1 parent 90b90c0 commit ad5a1db

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

โ€Žsrc/app/(auth)/login/page.tsxโ€Ž

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ export default function LoginPage() {
1919
router.push('/');
2020
},
2121
onError: (error) => {
22-
if (error.status === 404) {
23-
setError('email', {
24-
type: 'manual',
25-
message: '์กด์žฌํ•˜์ง€ ์•Š๋Š” ์ด๋ฉ”์ผ์ž…๋‹ˆ๋‹ค!',
26-
});
27-
} else if (error.status === 401) {
28-
setError('password', {
29-
type: 'manual',
30-
message: '๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค!',
22+
if (error.status === 401) {
23+
const { validationErrors } = error.detail;
24+
Object.keys(validationErrors).forEach((key) => {
25+
setError(key as 'email' | 'password', {
26+
type: 'manual',
27+
message: validationErrors[key],
28+
});
3129
});
3230
}
3331
},

0 commit comments

Comments
ย (0)