mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
19 lines
432 B
TypeScript
19 lines
432 B
TypeScript
import { createContext, Dispatch, SetStateAction } from "react";
|
|
import { AuthState, AUTH_STATUS } from "./types";
|
|
|
|
export const AuthenticationContext = createContext<{
|
|
authState: AuthState,
|
|
setAuthState?: Dispatch<SetStateAction<AuthState>>,
|
|
login?: (
|
|
usernameOrEmail: string,
|
|
password:string,
|
|
failureCallback?:()=>void
|
|
)=>void;
|
|
logout?: ()=>void;
|
|
}>({
|
|
authState:{
|
|
authStatus: AUTH_STATUS.INIT
|
|
}
|
|
});
|
|
|