fix: improve error handling in login mutation to display error messages
This commit is contained in:
parent
8b2de9472e
commit
37842177a6
1 changed files with 2 additions and 2 deletions
|
|
@ -46,8 +46,8 @@ export const FormLogin = () => {
|
|||
const utils = api.useUtils();
|
||||
|
||||
const { mutate, isPending } = api.auth.loginUser.useMutation({
|
||||
onError: () => {
|
||||
toast.error(t.auth.login.fail);
|
||||
onError: ({ message }) => {
|
||||
toast.error(`${t.auth.login.fail}\n${message}`);
|
||||
},
|
||||
onSuccess: async () => {
|
||||
await utils.auth.getSession.invalidate();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue