# Usuários não são redirecionados para a página original após login bem-sucedido

**URL:** https://meta.discourse.org/t/users-not-redirected-to-original-page-upon-successful-login/333978
**Category:** Support
**Created:** [Novembro 1, 2024, 8:59am UTC](https://meta.discourse.org/t/users-not-redirected-to-original-page-upon-successful-login/333978 "2024-11-01T08:59:37Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Agosto 14, 2025, 12:53pm UTC](https://meta.discourse.org/t/users-not-redirected-to-original-page-upon-successful-login/333978/5 "2025-08-14T12:53:00Z")

</div>

Corrigir em:

> <https://github.com/discourse/discourse/pull/34176>
>
> When an "anon" user visits a topic that is "private", they will get a page that …is server-rendered and doesn't load the client-side app.
> 
> When they click the "login" button, it will redirect to the /login route which loads the app. The only way we can know where the user landed initially is via the "document.referrer".
> 
> The issue was that the code that checked the referrer was \*\*after\*\* the code that is doing the redirection to discourse connect.
> 
> By putting the code before doing the redirection to discourse connect, we are successfully redirected to the landing url after doing the discourse connect auth.
> 
> I've also added a system spec that test the happy path by starting the most basic discourse connect compliant sso server in the background.

---

_[View the full topic](https://meta.discourse.org/t/users-not-redirected-to-original-page-upon-successful-login/333978)._
