# Google 登录后重定向回原始 URL

**URL:** <https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173>\
**Category:** Bug\
**Created:** [2018年一月16日 15:48 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173 "2018-01-16T15:48:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil.Dexter](https://avatars.discourse-cdn.com/v4/letter/p/a87d85/32.png) [@Phil.Dexter](https://meta.discourse.org/u/Phil.Dexter)\
**Post date:** [2018年一月16日 15:48 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/1 "2018-01-16T15:48:05Z")

</div>

I believe this is a bug, apologies if it’s not - I’m new here.

We have the exact same issue as this bug report from 3 years ago: [Redirect to requested URL after SSO](https://meta.discourse.org/t/redirect-to-requested-url-after-sso/27820)  
where when a user clicks on a link to a specific topic but is not logged in: he get’s redirected to the login page and after login in with Google SSO is redirected to the forum’s home page and not back to the original topic.

To reproduce:

1. enable login required
2. copy url of a topic
3. log out
4. paste url of a topic
5. log in with Google SSO
6. you are on the home page

Can it be that this is a regression and it broke again somehow?

Cheers  
:phil

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年一月16日 22:37 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/2 "2018-01-16T22:37:04Z")

</div>

This is not SSO related, it is social login related. We should fix it, but it is _very_ specific to social login, does not apply to

- SSO
- native login

at all

---

<div class="post-metadata">

**Author:** ![Phil.Dexter](https://avatars.discourse-cdn.com/v4/letter/p/a87d85/32.png) [@Phil.Dexter](https://meta.discourse.org/u/Phil.Dexter)\
**Post date:** [2018年一月17日 12:19 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/3 "2018-01-17T12:19:26Z")

</div>

OK, sorry if I miscategorized this.  
Is there an open topic on this? is there any development planned?

---

<div class="post-metadata">

**Author:** ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)\
**Post date:** [2018年一月17日 19:40 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/4 "2018-01-17T19:40:33Z")

</div>

It’s all good, it’s in the right place as a bug and will be fixed.

@codinghorror’s comment was in relation to the old post. Your issue is different in that it relates to social logins, not SSO.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2018年一月26日 17:53 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/6 "2018-01-26T17:53:45Z")

</div>

This is now fixed 🍎

[https://github.com/discourse/discourse/commit/e2d82b882ed55bf74325fb24e772961b1bb1833a](https://github.com/discourse/discourse/commit/e2d82b882ed55bf74325fb24e772961b1bb1833a)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年一月26日 23:13 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/7 "2018-01-26T23:13:07Z")

</div>

OK @Phil.Dexter can you grab latest code and confirm that this looks fixed on your end?

---

<div class="post-metadata">

**Author:** ![Phil.Dexter](https://avatars.discourse-cdn.com/v4/letter/p/a87d85/32.png) [@Phil.Dexter](https://meta.discourse.org/u/Phil.Dexter)\
**Post date:** [2018年一月29日 13:26 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/8 "2018-01-29T13:26:03Z")

</div>

Amazing! It’s fixed.

KUDOS

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2018年一月29日 13:42 UTC](https://meta.discourse.org/t/redirect-to-original-url-after-google-login/78173/9 "2018-01-29T13:42:49Z")

</div>


