We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90b90c0 commit ad5a1dbCopy full SHA for ad5a1db
โsrc/app/(auth)/login/page.tsxโ
@@ -19,15 +19,13 @@ export default function LoginPage() {
19
router.push('/');
20
},
21
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
30
- message: '๋น๋ฐ๋ฒํธ๊ฐ ์ผ์นํ์ง ์์ต๋๋ค!',
+ if (error.status === 401) {
+ const { validationErrors } = error.detail;
+ Object.keys(validationErrors).forEach((key) => {
+ setError(key as 'email' | 'password', {
+ type: 'manual',
+ message: validationErrors[key],
+ });
31
});
32
}
33
0 commit comments