Skip to content

Conversation

carloslopdev
Copy link

@carloslopdev carloslopdev commented Mar 8, 2025

After logout, auth-protected views are still accessible until page is refreshed.

Inertia docs warns about this behavior: https://inertiajs.com/history-encryption

Steps to reproduce:

  1. Login to dashboard page.
  2. Logout.
  3. Press back button in the browser.
  4. Dashboard is shown again.

With this changes, it redirects to login when going back after logout.

Tested in Firefox, but surely happening in all browsers and Vue Starter Kit as well.

Copy link
Contributor

@tnylea tnylea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carloslopdev,

Would you mind opening a PR in the Vue Starter kit that solves this same problem 🙏

Super appreciate it 😊

@carloslopdev
Copy link
Author

@tnylea Done!

laravel/vue-starter-kit#81


'history' => [

'encrypt' => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joetannenbaum this would only work on https, right?

@taylorotwell
Copy link
Member

Feel free to add this to your own app for now. This is default web browser behavior.

@carloslopdev carloslopdev deleted the going_back_after_logout branch March 12, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved for Merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants