Major: Added Authentication Functionality, interfaces with backend;

Added new styles to HomePage & VideoPage;
Added AuthContext to persist logged_in status;
This commit is contained in:
Chris-1010
2025-01-24 15:17:53 +00:00
parent ca2a7e9baf
commit 8ec60b1c41
24 changed files with 831 additions and 204 deletions

View File

@@ -0,0 +1,18 @@
import { createContext, useContext } from "react";
interface AuthContextType {
isLoggedIn: boolean;
setIsLoggedIn: (value: boolean) => void;
}
export const AuthContext = createContext<AuthContextType | undefined>(
undefined
);
export function useAuth() {
const context = useContext(AuthContext);
if (context === undefined) {
throw new Error("useAuth must be used within an AuthProvider");
}
return context;
}