Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-Logout Actions for SPA Logout Flow #4236

Open
3 of 5 tasks
nf-jst opened this issue Dec 4, 2024 · 0 comments
Open
3 of 5 tasks

Post-Logout Actions for SPA Logout Flow #4236

nf-jst opened this issue Dec 4, 2024 · 0 comments
Labels
feat New feature or request.

Comments

@nf-jst
Copy link

nf-jst commented Dec 4, 2024

Preflight checklist

Ory Network Project

No response

Describe your problem

Upon successful logout, the SPA logout flow currently sends a 204 No Content response (reference). This differs from other flows (e.g., login), which return a 200 OK response with a JSON payload that includes instructions for further actions, most notably the redirect_browser_to action.

According to the documentation, post-logout redirect is already supported for server-rendered browser applications and the returnTo URL can already be specified in the Kratos config (default_browser_return_url) and when creating the logout flow (reference).

It would be nice to have it also for SPAs for consistent behaviour.

Describe your ideal solution

The logout flow for SPAs should return a 200 OK response with a JSON payload that allows the application to perform post-logout actions, such as redirecting the user to a specific URL.

Example
200 OK

{
  "continue_with": [
    {
      "action": "redirect_browser_to",
      "redirect_browser_to": "http://localhost:4455/"
    }
  ]
}

Workarounds or alternatives

Currently I hard-code the post-logout redirect URL in the SPA.

Version

v1.3.1

Additional Context

No response

@nf-jst nf-jst added the feat New feature or request. label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request.
Projects
None yet
Development

No branches or pull requests

1 participant