✨ feat: create auth provider context
This commit is contained in:
14
shared/contexts/AuthContext.tsx
Normal file
14
shared/contexts/AuthContext.tsx
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user