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

Restore request and session on redirects #539

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

timacdonald
Copy link
Contributor

If there is an existing session on the redirect, it would be nice to restore it.

Inertia::location(
    redirect()->to('/login')
)->with('foo', 'bar');

Also restoring the request while I'm in there.

@rojtjo
Copy link
Contributor

rojtjo commented Aug 31, 2023

Wouldn't it make more sense to just return the original RedirectResponse instead of creating a new one? That way any other custom value such as the status code would also be preserved.

@timacdonald
Copy link
Contributor Author

@rojtjo yes! yes it would. Was too close to the project. Changed the approach.

@jessarcher
Copy link
Member

Thank you!

@jessarcher jessarcher merged commit b79dadf into inertiajs:master Sep 13, 2023
@timacdonald timacdonald deleted the session branch September 13, 2023 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants