feat(auth): Added authentication
This commit is contained in:
parent
d85d4334f8
commit
5e100c75ed
39 changed files with 704 additions and 86 deletions
|
|
@ -1,6 +1,18 @@
|
|||
import ServerList from "./Components/ServerList/ServerList"
|
||||
import { useEffect } from "react";
|
||||
import ServerList from "./Components/ServerList/ServerList";
|
||||
import Cookies from "js-cookie";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
const Index = () => {
|
||||
const navigate = useNavigate();
|
||||
const sessionCookie = Cookies.get("session");
|
||||
|
||||
useEffect(() => {
|
||||
if (!sessionCookie) {
|
||||
navigate("/login");
|
||||
}
|
||||
}, [navigate, sessionCookie]);
|
||||
|
||||
return (
|
||||
<div style={{ width: "100%", padding: "20px", display: "flex", flexDirection: "column", alignItems: "center" }}>
|
||||
<h1>Available Servers</h1>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue