mirror of
https://github.com/gabehf/BudgetBuddy.git
synced 2026-03-08 23:18:15 -07:00
Signup and Login working
This commit is contained in:
parent
87b444b283
commit
81ee4c7d8a
6 changed files with 125 additions and 27 deletions
|
|
@ -7,25 +7,22 @@ import "./NavBar.css"
|
|||
import checkLogin from "../utils/utils";
|
||||
|
||||
export default function NavBar() {
|
||||
const [auth, setAuth] = React.useState(true);
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
|
||||
const handleLogin = () => {
|
||||
setAuth(true);
|
||||
handleClose();
|
||||
window.location.href='/login';
|
||||
}
|
||||
|
||||
const handleSignup = () => {
|
||||
setAuth(true);
|
||||
handleClose();
|
||||
window.location.href='/signup'
|
||||
window.location.href='/signup';
|
||||
}
|
||||
|
||||
const handleLogout= () => {
|
||||
setAuth(false);
|
||||
handleClose();
|
||||
window.location.href='/welcome'
|
||||
document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
|
||||
window.location.href='/welcome';
|
||||
}
|
||||
|
||||
const handleMenu = (event) => {
|
||||
|
|
@ -47,7 +44,7 @@ export default function NavBar() {
|
|||
</Typography>
|
||||
</Link>
|
||||
<div className="nav-login-control">
|
||||
{!checkLogin
|
||||
{checkLogin()
|
||||
? // Logged In
|
||||
<div>
|
||||
<IconButton
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue