Feature/add logout return url config #13
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey Taylor,
I ran into an issue when managing multiple Laravel applications that share the same WorkOS account,
where the logout redirect behavior wasn't flexible enough for multi-app setups.
Problem:
When you have multiple Laravel applications using the same WorkOS account with different redirect
URLs configured in WorkOS, there's currently no way to specify where users should be redirected
after logout. This creates problems when:
destinations
setup
Real-world scenario:
WorkOS Account Setup:
├── App A (staging.myapp.com) - Needs redirect to staging.myapp.com/welcome after logout
├── App B (prod.myapp.com) - Needs redirect to prod.myapp.com/welcome after logout
└── App C (admin.myapp.com) - Needs redirect to admin.myapp.com/login after logout
Problem: After logout, WorkOS doesn't know which app URL to redirect to
Proposed solution:
Add a configurable logout redirect URL so each Laravel app can specify exactly where users should
be redirected after successful logout:
config(['workos.logout_redirect_url' => 'https://staging.myapp.com/welcome']);
If this PR merged i will add this config to laravel workos starter kits.
Changes made:
This is especially important when you have multiple redirect URLs configured in your WorkOS
redirections setup and need to ensure users are redirected to the correct application after logout,
particularly when apps don't have a home page URL configured.