© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
harshcut

nextjs auth redirects when already logged in

how to redirect to
/u/dashboard
/u/dashboard
(protected page) with
@supabase/auth-helpers-nextjs
@supabase/auth-helpers-nextjs
when user is already logged in?

// login.tsx
export const getServerSideProps: GetServerSideProps = async (context) => {
  return { props: {} }
}
// login.tsx
export const getServerSideProps: GetServerSideProps = async (context) => {
  return { props: {} }
}
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Admin Auth Signup and Stay Logged In
SupabaseSSupabase / help-and-questions
4y ago
Auth redirects to protected route
SupabaseSSupabase / help-and-questions
4y ago
Is Anyone already use UseUser from auth helper react and nextjs
SupabaseSSupabase / help-and-questions
4y ago
Nextjs with auth-ui
SupabaseSSupabase / help-and-questions
3y ago