IT builds again.

master
Joshua Sigona 3 years ago
parent dbc0a878df
commit b8ffa83465
  1. 12
      src/TestHeader.js

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

Loading…
Cancel
Save