Skip to content

refactor: renew guest links via session cookie - #3942

Merged
JammingBen merged 6 commits into
mainfrom
refactor/renew-guest-sessions
Oct 21, 2026
Merged

JammingBen merged 6 commits into
mainfrom
refactor/renew-guest-sessions

Conversation

@JammingBen

@JammingBen JammingBen commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

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.

@JammingBen JammingBen self-assigned this Oct 20, 2026
@JammingBen JammingBen added the Type:Maintenance E.g. technical debt, packaging, etc. label Oct 20, 2026
@JammingBen
JammingBen force-pushed the refactor/renew-guest-sessions branch from 1000b66 to 7bb0b0e Compare October 20, 2026 14:00
@JammingBen
JammingBen marked this pull request as ready for review October 20, 2026 14:21
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Oct 20, 2026
@AlexAndBear AlexAndBear moved this from Qualification to Needs Review in OpenCloud Team Board Oct 20, 2026
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.
@JammingBen
JammingBen force-pushed the refactor/renew-guest-sessions branch from 7bb0b0e to 5c290aa Compare October 21, 2026 09:47

@AlexAndBear AlexAndBear left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

  1. 🔴 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)

  2. 🔴 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)

  3. 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)

  4. "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.

  5. Small stuff:

    • One test in authService.spec.ts (around line 1078) still sets the old link token, so it doesn't test anything anymore.

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).

@JammingBen
JammingBen force-pushed the refactor/renew-guest-sessions branch from ee480be to c6087e6 Compare October 21, 2026 14:14
@JammingBen

Copy link
Copy Markdown
Member Author

Thanks, all of these should be fixed.

@AlexAndBear AlexAndBear left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@JammingBen
JammingBen merged commit 3f3c6bc into main Oct 21, 2026
27 checks passed
@JammingBen
JammingBen deleted the refactor/renew-guest-sessions branch October 21, 2026 15:25
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in OpenCloud Team Board Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Maintenance E.g. technical debt, packaging, etc.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants