-
- Thank you... fantasy football draft, for letting me know that even
- in my fantasies, I am bad at sports.
-
-
Jimmy Fallon
+
+ {(isSignedIn === null || isSignedIn === true) &&
+
+ }
+ {isSignedIn === false &&
+ <>
+
+
+
+
+ Thank you... fantasy football draft, for letting me know that even
+ in my fantasies, I am bad at sports.
+
+
Jimmy Fallon
+
-
-
-
- Join Gridiron Survivor
-
-
- Log in to your existing account or{' '}
- sign up to get started
- with a league
-
+
+
+
+ Join Gridiron Survivor
+
+
+ Log in to your existing account or{' '}
+ sign up to get started
+ with a league
+
+
+
+
-
-
-
+ >
+ }
);
};
diff --git a/context/AuthContextProvider.tsx b/context/AuthContextProvider.tsx
index eb1adb9b..6e6964e5 100644
--- a/context/AuthContextProvider.tsx
+++ b/context/AuthContextProvider.tsx
@@ -23,7 +23,7 @@ type AuthContextType = {
getUser: () => Promise
;
login: (user: UserCredentials) => Promise; // eslint-disable-line no-unused-vars
logoutAccount: () => Promise;
- isSignedIn: boolean;
+ isSignedIn: boolean | null;
};
export const AuthContext = createContext(null);
@@ -39,7 +39,7 @@ export const AuthContextProvider = ({
}: {
children: React.ReactNode;
}): JSX.Element => {
- const [isSignedIn, setIsSignedIn] = useState(false);
+ const [isSignedIn, setIsSignedIn] = useState(null);
const { updateUser, resetUser, user } = useDataStore(
(state) => state,
);
@@ -86,6 +86,7 @@ export const AuthContextProvider = ({
*/
const getUser = async (): Promise => {
if (!isSessionInLocalStorage()) {
+ setIsSignedIn(false);
if (isAuthRequiredPath(pathname)) {
router.push('/login');
}
diff --git a/context/AuthHelper.interface.ts b/context/AuthHelper.interface.ts
index 44791ed4..d62abed6 100644
--- a/context/AuthHelper.interface.ts
+++ b/context/AuthHelper.interface.ts
@@ -7,5 +7,5 @@ import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.share
export interface ILogoutType {
resetUser: React.Dispatch>;
router: AppRouterInstance;
- setIsSignedIn: React.Dispatch>;
+ setIsSignedIn: React.Dispatch>;
}