feat: create auth provider context

This commit is contained in:
2026-01-20 11:27:09 +07:00
parent e27b18b22e
commit eae3b2b3fc
10 changed files with 99 additions and 18 deletions

View File

@ -0,0 +1,14 @@
import { createContext, useContext } from "react";
import { UserSession } from "../models/auth/validateAndDecodeJWT";
type AuthContextType = {
session: UserSession | null;
};
export const AuthContext = createContext<AuthContextType>({
session: null,
});
export function useAuth() {
return useContext(AuthContext);
}