Dudley C 3 years ago
commit f0f0a1408b
  1. 12
      src/TestHeader.js

@ -7,22 +7,24 @@ const cookies = require('cookie-handler');
function TestHeader(p) {
const {BACKENDURL,LOGGEDINUSER,LOGGEDINHASH} = p;
const [avatar,setAvatar] = useState(undefined);
const [username,setUsername] = useState(undefined);
useEffect(()=>{
axios.post(p.BACKENDURL+"/validUser",{
username:p.LOGGEDINUSER,
password:p.LOGGEDINHASH,
axios.post(BACKENDURL+"/validUser",{
username:LOGGEDINUSER,
password:LOGGEDINHASH,
recoveryhash:cookies.get("userID")
})
.then((data)=>{
if (data.data.verified) {
setAvatar(data.data.avatar)
setUsername(p.LOGGEDINUSER)
setUsername(LOGGEDINUSER)
}
})}
,[])
,[BACKENDURL,LOGGEDINUSER,LOGGEDINHASH])
return (
<header>

Loading…
Cancel
Save