Generate an "email me a login link" URL

Hi,

We have a website that sends alerts to users via email, and for a seamless experience, we want to provide a link to Discourse that automatically logs them in. We already have DiscourseConnect set up and functioning, but we want to bypass the step where users have to click “Login” on Discourse.

Since we already have the users registered in our system (as we are sending them emails), we would like to automatically log them into Discourse if they already have an account. Is there a way to generate an “automatic login” link that we can send to these users via email?

1 Like

Hi there!
Are you referring to the bit where it says ‘Skip password, email me a login link’?

Since you’re using DiscourseConnect, sending them to /login will automatically start the login flow.

Or, if you want to include a landing page you can use (I’m pretty sure) /session/sso?return_path=«/path/to/landingpage»

2 Likes

@NateDhaliwal @supermathie thanks for chiming in. I work with @jonathan_moura_getit so I thought I would attempt to make this a bit more clear.

What we want is a way to send a logged in or new user to discourse from our system - without them having to go to a page, hit ‘login’ and get redirected back to discourse. The best way to think about this is a user comes to our site, logins in, sees a link to post on discourse, is directed to discourse (already logged in). They don’t have to click anything, they are logged in the moment they hit discourse.

Can someone advise on how we can do this?

1 Like

Have you tried my suggestion?

You can see it in action at e.g.:

Assuming one is already logged in to Spiceworks’ system, you’ll get automatically logged into their Discourse install without needing to click anything.

1 Like