mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-21 05:09:18 +00:00
feat: display erros messages on login errors
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useHistory } from "react-router-dom";
|
||||
|
||||
import { toast } from "react-toastify";
|
||||
|
||||
import api from "../../services/api";
|
||||
|
||||
const useAuth = () => {
|
||||
@@ -33,7 +35,7 @@ const useAuth = () => {
|
||||
} catch (err) {
|
||||
setLoading(false);
|
||||
setIsAuth(false);
|
||||
alert("Erro de autenticação. Por favor, faça login novamente");
|
||||
toast.error("Erro de autenticação. Por favor, faça login novamente");
|
||||
}
|
||||
};
|
||||
checkAuth();
|
||||
@@ -50,7 +52,7 @@ const useAuth = () => {
|
||||
setIsAuth(true);
|
||||
history.push("/chat");
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
toast.error("Erro de autenticação. Verifique os dados de login");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user