Replies: 1 comment 1 reply
-
When you call
And on that const [session, loading] = useSession()
const router = useRouter()
const isLoggedIn = !!session?.user
const isNewUser = session?.user.isNewUser
React.useEffect(() => {
if(!isLoggedIn) return router.push("/login")
if(isNewUser) return router.push("/app/gettingstarted")
}, [isLoggedIn, isNewUser, router]) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've augmented the user to take an
isNewUser
field to determine whether or not it's a sign up OR sign in. How do I redirect to a different URL on sign up? The callbackURL is a string field and not a function?I'd love to know how people have done this. This is what I have which doesn't work:
login.tsx
_app.tsx
There is confusion because the callback URL goes to a fixed URL but I need it to be different depending on the flag. Has anybody solved this?
Beta Was this translation helpful? Give feedback.
All reactions