getkirby / kirby

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

Session timeout throws API error and then lock error #3780

Closed GiantCrocodile closed 3 years ago

GiantCrocodile commented 3 years ago

Describe the bug
When you idle too long, you are logged out automatically and an API error is thrown in console.

To Reproduce
Steps to reproduce the behavior:

  1. log in to the panel
  2. wait some minutes until you are logged off automatically
  3. see the console for error message
  4. (optional:) wait even longer to get another error and a popup with text "this.lock is null"

Expected behavior
no error thrown because timeout is fine and no auth-requiring API calls shall be sent if you do nothing/if you have been logged off

Console output

GEThttp://localhost/kirby/api/auth
[HTTP/1.1 403 Forbidden 1373ms]
Object { status: "error", message: "Unauthenticated", code: 403, exception: "Kirby\\Exception\\PermissionException", key: "error.permission", file: "/kirby/kirby/config/api/authentication.php", line: 14, details: [], route: "auth" }
Object { status: "error", message: "Unauthenticated", code: 403, exception: "Kirby\\Exception\\PermissionException", key: "error.permission", file: "/kirby/kirby/config/api/authentication.php", line: 14, details: [], route: "auth" }
TypeError: this.lock is null
    isLocked http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    get http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    evaluate http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    xn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    om http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    _render http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    r http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    get http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    run http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    dn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    te http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    Ut http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    promise callback*qt http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    te http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    notify http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    set http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    set http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    onSwap http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    setState http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    go http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    reload http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    $reload http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    check http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    setInterval handler*created http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    Vt http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    nn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    _init http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    a http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    componentInstance http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    init http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    f http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    f http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    v http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    f http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    v http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    f http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    Ho http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    _update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    r http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    get http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    vn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    mount http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    $mount http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    $mount http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    init http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    f http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    f http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    Ho http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    _update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    r http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    get http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    vn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    mount http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
index.js:1:15472
Uncaught TypeError: this.$refs.overlay is undefined
    focus http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    open http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    setTimeout handler*open http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    open http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    te http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    Ut http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    promise callback*qt http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    te http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    $nextTick http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    mounted http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    Vt http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    nn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    insert http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    O http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    Ho http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    _update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    r http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    get http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    run http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    dn http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    te http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    Ut http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    promise callback*qt http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    te http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    update http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    notify http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    set http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    set http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/vendor.js:6
    onSwap http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    setState http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    go http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    reload http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    $reload http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1
    check http://localhost/kirby/media/panel/2ef2684f2d4754039c83273057368dc2/js/index.js:1

Desktop (please complete the following information):
Windows 10, latest Firefox

Additional info:

bastianallgeier commented 3 years ago

Related: https://github.com/getkirby/kirby/issues/3779

This is intended behaviour.

GiantCrocodile commented 3 years ago

@bastianallgeier I see how the errors in console are intended behavior but I think throwing a popup to the user with text "this.lock is null" is not intended.

bastianallgeier commented 3 years ago

@GiantCrocodile sorry for closing this too early. I completely missed that point about locking. Now we can really close it though :)

GiantCrocodile commented 3 years ago

@bastianallgeier Thank you for the excuse. I appreciate it because I wasn't too happy about that.