# Desired URL lost if \`login required\` is enabled and social logins are used

**URL:** <https://meta.discourse.org/t/desired-url-lost-if-login-required-is-enabled-and-social-logins-are-used/71887>\
**Category:** Bug\
**Created:** [2017 年10 月 11 日 23:17 UTC](https://meta.discourse.org/t/desired-url-lost-if-login-required-is-enabled-and-social-logins-are-used/71887 "2017-10-11T23:17:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
发布日期： [2017 年10 月 11 日 23:17 UTC](https://meta.discourse.org/t/desired-url-lost-if-login-required-is-enabled-and-social-logins-are-used/71887/1 "2017-10-11T23:17:29Z")

</div>

If you visit [https://discourse.fictiousexample.com/t/my-fine-topic/12345](https://discourse.fictiousexample.com/t/my-fine-topic/12345) and `login required` is enabled, you’re redirected to [https://discourse.fictiousexample.com/](https://discourse.fictiousexample.com/). Then you have to click the login button, and then you’re redirected back to the home page rather than the topic that you wanted in the first place.

What I would expect to happen (and what my client using auth0 wants to happen) is when you access a topic and are not logged in, you’d go straight tot the log in and be redirected to the topic after you’re logged in.

I thought at first it was a problem with [GitHub - auth0/discourse-plugin: Discourse plugin to authenticate with auth0. · GitHub](https://github.com/auth0/discourse-plugin), but the problem seems to be with the `login required` setting rather than the plugin.

This seems similar to the problem of trying to access a protected topic when you’re not logged in. What happens in that case is you get a 404 and are then on your own to log in and try again to access that URL.

Would it be possible to when hitting a route that is protected to give the user an opportunity to log in before giving up?

---

_[View the full topic](https://meta.discourse.org/t/desired-url-lost-if-login-required-is-enabled-and-social-logins-are-used/71887)._
