Created a really basic history page

This commit is contained in:
Tiago Ribeiro
2023-04-28 18:19:29 +01:00
parent 240bf1c790
commit 06de06fbf6
8 changed files with 122 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ export default function useUser({redirectTo = "", redirectIfFound = false} = {})
// if no redirect needed, just return (example: already on /dashboard)
// if user data not yet there (fetch in progress, logged in or not) then don't do anything yet
if (!redirectTo || !user) return;
if (redirectTo && !user) {
Router.push(redirectTo);
}
if (
// If redirectTo is set, redirect if the user was not found.