Repository navigation
refactor: renew guest links via session cookie - #3942
Conversation
1000b66 to
7bb0b0e
Compare
The server now authorizes guest link renewals with the session cookie instead of the previous link token. With a valid session it sends a new link and a PIN bound to this browser via a nonce cookie, without one it only sends a new link. Drop the stored link token, which also fixes renewals after a PIN login where web never knew the new token. Only show the PIN form for renewals that include a PIN and treat a PIN as expired once its renewal expired.
7bb0b0e to
5c290aa
Compare
There was a problem hiding this comment.
I gave this a review and a deep browser test against the latest daily backend. The normal guest flow, guest permalinks, public links and mobile all work fine.
-
🔴 Regression: the guest is sent to a link that no longer works. When an unused invitation link has expired, the server already sends a new one. But the page tells the guest to open the link from their most recent email, and that one was just replaced. So the guest lands on "Ask the person who invited you", although a new email is already on its way. Better: just say that a new link is on its way and the old one doesn't work anymore. (
renewGuestLink.vue:197-202) -
🔴 Regression: a guest can get stuck on "Check your inbox" for 30 minutes. After a renewal we remember it for 30 min and don't ask the server again. We also do that when the server didn't send anything (because a newer link was still valid). If that newer link then gets used up, e.g. on another device, the guest only sees "Check your inbox" and never gets a new email until the 30 min are over. The same can happen on main with a real renewal. Idea: forget the remembered renewal as soon as the newest link turns out to be expired or used. (
guestSessionManager.ts:198,renewGuestLink.vue:228) -
Removed share: the guest is sent to the email link (also on main). If the share is gone, the page still tells the guest to open the link from the email, which fails too. It should say "Ask the person who invited you" right away, like it does for an expired share. The new test currently locks in the old text. (
renewGuestLink.vue:133-139) -
"Too many requests": the new message is way better than main, but there's no "Try again" and we don't tell the guest how long to wait, although the server sends that. A conflict error is also shown as final, while the backend says it's fine to just try again.
-
Small stuff:
- One test in
authService.spec.ts(around line 1078) still sets the old link token, so it doesn't test anything anymore.
- One test in
Not from this PR (also on main): after opening a guest link successfully, the console logs "guest link could not be resolved: unknown". It's only noise, the canceled task just isn't filtered out (resolveGuestLink.vue:114).
ee480be to
c6087e6
Compare
|
Thanks, all of these should be fixed. |
There was a problem hiding this comment.
LGTM,
one thing I've noticed:
When you are a guest, that still has a valid session but open /g/renew/…, you directl end up on "Access denied – Not logged in" afterwards when going to the shares, because the renew page drops the guest context.
But I don't know if this will have any real impact
Not reproducible anymore within multiple tries, must have been a hiccup
The server now authorizes guest link renewals with the session cookie instead of the previous link token. With a valid session it sends a new link and a PIN bound to this browser via a nonce cookie, without one it only sends a new link.
Drop the stored link token, which also fixes renewals after a PIN login where web never knew the new token. Only show the PIN form for renewals that include a PIN and treat a PIN as expired once its renewal expired.
This refactor is necessary because of what opencloud-eu/opencloud#3704 and opencloud-eu/opencloud#3742 did.
Note that the PIN flow is currently unreachable; it will be re-introduced with #3797 later on.