mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 04:39:20 +00:00
fix: can't create new user after logout an existing one
This commit is contained in:
@@ -23,7 +23,6 @@ const useAuth = () => {
|
|||||||
if (token) {
|
if (token) {
|
||||||
api.defaults.headers.Authorization = `Bearer ${JSON.parse(token)}`;
|
api.defaults.headers.Authorization = `Bearer ${JSON.parse(token)}`;
|
||||||
setIsAuth(true);
|
setIsAuth(true);
|
||||||
setLoading(false);
|
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
||||||
@@ -32,8 +31,8 @@ const useAuth = () => {
|
|||||||
const token = localStorage.getItem("token");
|
const token = localStorage.getItem("token");
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers["Authorization"] = `Bearer ${JSON.parse(token)}`;
|
config.headers["Authorization"] = `Bearer ${JSON.parse(token)}`;
|
||||||
|
setIsAuth(true);
|
||||||
}
|
}
|
||||||
setIsAuth(true);
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
|||||||
Reference in New Issue
Block a user