2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-17 18:04:11 +08:00
discourse/lib/auth
Régis Hanol ced043be3c
FIX: 'destination_url' cookie handling (#33072)
Since the introduction of dedicated login and signup pages (as opposed
to modals), we've been seeing reports of issues where visitors aren't
redirected back to the "page" they were at when they initiated the
_authentication_ process.

Since we have a bazillion of ways a user might authenticate
(credentials, social logins, SSO, passkeys, discourse connect, etc...),
it's really hard to know what a change will impact.

The goal of this PR is to "simplify" the way we handle this "redirection
back to origin" by leveraging the use of a single `destination_url`
cookie set on the client-side.

The changes remove scattered cookie-setting code and consolidate the redirection logic to ensure users are properly redirected back to their original page after authentication.

- Centralized destination URL cookie management in routes and authentication flows
- Removed manual cookie setting from various components in favor of automatic handling
- Updated test scenarios to properly test the new redirection behavior
2025-08-06 10:09:01 +02:00
..
auth_provider.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
current_user_provider.rb DEV: lint against Layout/EmptyLineBetweenDefs (#24914) 2023-12-15 23:46:04 +08:00
default_current_user_provider.rb FIX: Incorrect topic per-minute invitation rate limit (#31252) 2025-02-10 13:12:16 +10:00
discord_authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
discourse_id_authenticator.rb FEATURE: pass email to external auth on signup (#33559) 2025-07-15 16:17:01 +02:00
facebook_authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
github_authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
google_oauth2_authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
linkedin_oidc_authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00
managed_authenticator.rb FIX: 'destination_url' cookie handling (#33072) 2025-08-06 10:09:01 +02:00
oauth_faraday_formatter.rb DEV: Include a basic oauth faraday formatter in core for usage in managed authenticators (#28758) 2024-09-05 22:29:29 +08:00
result.rb DEV: Add code comments around oauth user-api-key/new handling (#31774) 2025-03-12 14:01:20 -04:00
twitter_authenticator.rb FEATURE: add link to "associated accounts" providers (#33275) 2025-06-20 10:22:29 +02:00