Send user details to ping auth route
This commit is contained in:
parent
9f5d54d83f
commit
daee96ce3f
|
@ -64,15 +64,22 @@ function App() {
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
user && requester('/ping/', 'POST', token, {})
|
if (user) {
|
||||||
.then()
|
const data = {
|
||||||
.catch(err => {
|
id: user.member.id,
|
||||||
console.log(err);
|
username: user.username,
|
||||||
if (err.data && err.data.detail === 'Invalid token.') {
|
path: history.location.pathname,
|
||||||
logout(); // You Sure?
|
};
|
||||||
logout();
|
requester('/ping/', 'POST', token, data)
|
||||||
}
|
.then()
|
||||||
});
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
if (err.data && err.data.detail === 'Invalid token.') {
|
||||||
|
logout(); // You Sure?
|
||||||
|
logout();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}, [history.location]);
|
}, [history.location]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user