getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

[3.6.0] Panel view flickering/appearing when browser back button usage #3469

Closed afbora closed 3 years ago

afbora commented 3 years ago

Describe the bug

Panel view flickering/appearing when click back button after logout.

To Reproduce
Steps to reproduce the behavior:

  1. Go to panel
  2. Login to panel
  3. Logout from panel
  4. Click browser back button
  5. See issue

Expected behavior

If user no permission, user should redirect without flicker or view the page that have no access.

Screenshots

flicker

Kirby Version

3.6.0 develop branch

Console output

code: 403
details: []
exception: "Kirby\\Exception\\PermissionException"
file: "/test/kirby/develop/kirby/config/api/authentication.php"
key: "error.permission"
line: 26
message: "Unauthenticated"
route: "site/sections/([a-zA-Z0-9\\.\\-_%= \\+\\@\\(\\)]+)"
status: "error"
__proto__: Object
afbora commented 3 years ago

It revealed another issues:

  1. Renders page as JSON:

To Reproduce
Steps to reproduce the behavior:

  1. Go to panel
  2. Login to panel
  3. Click browser back button twice
  4. Click browser forward button
  5. See JSON output

screen-capture-1102--localhost

  1. Site title changed but view not when browser back (especially after logout)
distantnative commented 3 years ago

Right now, for me in Google Chrome the forward button gets disabled immediately after clicking the back button.

I would imagine this is due to the simplification @bastianallgeier made: https://github.com/getkirby/kirby/blob/develop/panel/src/config/fiber.js#L204

afbora commented 3 years ago

I didn't realize browser buttons because I always use mouse back/forward buttons 🙂

distantnative commented 3 years ago

Ok back/forward buttons now work, but yes seeing the JSOn responses.

I think on back/forward buttons we need to do a full reload.

distantnative commented 3 years ago

Just tried to debug it and test... but now back button works again, but instead the forward button gets disabled immediately.

bastianallgeier commented 3 years ago

I think it's a problem that we modify the history again in the reload method. We should have a way to reload the state without changing the history again.

bastianallgeier commented 3 years ago

I would like to close this in favour of a new issue.

The flickering does no longer happen. But now the forward button does not work at all.