© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
5 replies
aar2dee2

Discourse SSO with Supabase Magic Link login

I have a NextJS + Supabase app where I'm using magic link for Auth. I also have a Discourse (https://www.discourse.org) instance setup on one of the app subdomains. I want to log in to the Discourse forum using the Supabase Auth already setup. Discourse allows for this by including a payload containing the redirect_url in the url for the login route (see screenshot and doc link below). How can I include this in the magic link that Supabase sends to the user's email? (I'm using Amazon SES for the custom SMTP)

Supabase login code in my app:
const { error } = await supabaseClient.auth.signIn(
        { email: email },
        {
          redirectTo: `http${
            process.env.NODE_ENV == "production" ? "s" : ""
          }://app.${process.env.NEXT_PUBLIC_APP_DOMAIN}/dashboard`,
        }
      );
const { error } = await supabaseClient.auth.signIn(
        { email: email },
        {
          redirectTo: `http${
            process.env.NODE_ENV == "production" ? "s" : ""
          }://app.${process.env.NEXT_PUBLIC_APP_DOMAIN}/dashboard`,
        }
      );

Reference doc for setting up SSO in Discourse: https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045
Screenshot_2022-10-07_at_11.22.33_AM.png
Discourse - Civilized Discussion
Discourse - Civilized Discussion
Discourse is modern forum software for your community. Use it as a mailing list, discussion forum, long-form chat room, and more!
Discourse - Civilized Discussion
Discourse Meta
Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)
DiscourseConnect allows you to configure “Single Sign-On (SSO)” to completely outsource all user registration and login from Discourse to another site. ℹ (Feb 2021) ‘Discourse SSO’ is now ‘DiscourseConnect’. If you are running an old version of Discourse, the settings below will be named sso_... rather than discourseconnect... The Probl...
Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

magic link login with flutter
SupabaseSSupabase / help-and-questions
4y ago
[Nuxt] Login flow with magic link
SupabaseSSupabase / help-and-questions
13mo ago
Supabase Magic Link Authentication Issue:
SupabaseSSupabase / help-and-questions
13mo ago
Self-hosted SB magic link login with SMTP
SupabaseSSupabase / help-and-questions
2w ago