15 lines
296 B
TypeScript
15 lines
296 B
TypeScript
import { useContext } from "react";
|
|
import AuthContext from "../context/AuthProvider";
|
|
|
|
interface loginInfo {
|
|
loginNeeded: boolean;
|
|
isLoggedIn: boolean;
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
const useAuth = () => {
|
|
return useContext<loginInfo>(AuthContext);
|
|
};
|
|
|
|
export default useAuth; |