fix: Change auth error response formatting
This commit is contained in:
parent
644deb31d7
commit
fb2592960c
@ -54,13 +54,8 @@ export const actions = {
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
if ((e as APIError).body.code === 'INVALID_EMAIL_OR_PASSWORD') {
|
||||
return setError(form, 'password', 'Invalid email or password', {
|
||||
status: 401,
|
||||
});
|
||||
} else {
|
||||
return setError(form, 'password', (e as APIError).message as string);
|
||||
}
|
||||
const errorMessage = (e as APIError).body.message as string;
|
||||
return setError(form, 'password', errorMessage.charAt(0).toUpperCase() + errorMessage.slice(1));
|
||||
}
|
||||
|
||||
return message(form, 'Successfuly signed in.');
|
||||
|
@ -57,7 +57,8 @@ export const actions = {
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
return setError(form, 'verify', (e as APIError).message as string);
|
||||
const errorMessage = (e as APIError).body.message as string;
|
||||
return setError(form, 'verify', errorMessage.charAt(0).toUpperCase() + errorMessage.slice(1));
|
||||
}
|
||||
|
||||
return message(form, 'Successfuly signed in.');
|
||||
|
Loading…
Reference in New Issue
Block a user