Send user details to ping auth route

This commit is contained in:
Tanner Collin 2020-08-03 03:26:20 +00:00
parent 9f5d54d83f
commit daee96ce3f

View File

@ -64,7 +64,13 @@ function App() {
} }
useEffect(() => { useEffect(() => {
user && requester('/ping/', 'POST', token, {}) if (user) {
const data = {
id: user.member.id,
username: user.username,
path: history.location.pathname,
};
requester('/ping/', 'POST', token, data)
.then() .then()
.catch(err => { .catch(err => {
console.log(err); console.log(err);
@ -73,6 +79,7 @@ function App() {
logout(); logout();
} }
}); });
}
}, [history.location]); }, [history.location]);
useEffect(() => { useEffect(() => {