token valid fix
This commit is contained in:
parent
eab409b182
commit
8819e41a80
|
@ -24,13 +24,13 @@ export default function App() {
|
||||||
token ="";
|
token ="";
|
||||||
}
|
}
|
||||||
const tokenRes = await Axios.post(
|
const tokenRes = await Axios.post(
|
||||||
"http://localhost:5000/users/tokenIsValid",
|
"https://server-locaft.herokuapp.com/users/tokenIsValid",
|
||||||
null,
|
null,
|
||||||
{headers: {"x-auth-token": token }}
|
{headers: {"x-auth-token": token }}
|
||||||
|
|
||||||
);
|
);
|
||||||
if (tokenRes.data) {
|
if (tokenRes.data) {
|
||||||
const userRes = await Axios.get("http://localhost:5000/users/",
|
const userRes = await Axios.get("https://server-locaft.herokuapp.com/users/",
|
||||||
{headers:{"x-auth-token":token},
|
{headers:{"x-auth-token":token},
|
||||||
});
|
});
|
||||||
setUserData({
|
setUserData({
|
||||||
|
|
Loading…
Reference in New Issue