Ignore:
Timestamp:
01/13/24 23:19:50 (9 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
e85a562
Parents:
e9b4ba9
Message:

authContext impl, admin panel impl, search bar fixes, reservations listings impl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Pages/LoginPage.js

    re9b4ba9 rac19a0c  
    33import { Container } from "react-bootstrap";
    44import Navigation from "../Components/Layout/Navbar/Navigation";
     5import {useAuth} from "../Components/Context/AuthContext";
     6import {Navigate} from "react-router-dom";
     7
    58
    69const LoginPage = () => {
     
    811  document.body.style.marginTop = "auto";
    912  document.body.style.marginBottom = "auto";
     13
     14  const Auth = useAuth();
     15  const isLoggedIn = Auth.userIsAuthenticated();
     16
     17    if (isLoggedIn) {
     18        return <Navigate to={'/home'}/>
     19    }
     20
    1021  return (
    1122    <>
Note: See TracChangeset for help on using the changeset viewer.