Skip to content

fix(web): retain cloud destination on login retry - #551

Merged
Maxerns merged 3 commits into
getsotto:mainfrom
cyncui:fix/cloud-login-retry
Oct 14, 2026
Merged

Maxerns merged 3 commits into
getsotto:mainfrom
cyncui:fix/cloud-login-retry

Conversation

@cyncui

@cyncui cyncui commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

why

a failed oauth state check leaves the original /cloud destination in session storage. try again started a new login with the default /app destination. closes #547.

what changed

  • pass the stored destination to startLogin(), which already restricts it to /cloud or /app.
  • add a component test that clicks the real retry control and checks the new state, cleared query, destination, and redirect for cloud and fallback cases.

scope

  • covers retries after callback verification fails. the initial login and successful callback paths are unchanged.
  • does not exercise a live oauth provider.

blast radius

only callback retry navigation changes. missing or unsupported stored destinations still use /app.

verification

  • focused callback and login tests passed, 9 tests.

  • the web suite passed, 137 tests, using temporary stand-ins for generated wasm files that the loader tests mock. the files were removed after the run.

  • typecheck passed with a temporary declaration for the unavailable generated wasm module. chrome qa passed for cloud, missing, and unsupported destinations with an oauth endpoint stub.

  • i signed off every commit (git commit -s / developer certificate of origin).

cyncui added 2 commits October 7, 2026 09:03
Signed-off-by: cynthia cui <cynthiacui98@gmail.com>
Signed-off-by: cynthia cui <cynthiacui98@gmail.com>

@Maxerns Maxerns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks minimal and correct.

Passing the stored destination back through the existing startLogin allowlist is the right approach. It reuses the existing validation, avoids introducing another parsing path, and doesn’t open up an open-redirect risk. The hostile-destination case proves the fallback still works as intended.

I also reverted the fix locally as a regression check, and exactly the /cloud case failed. The other three tests still pass, which is a good sign that they’re pinning the existing safe behaviour rather than just the new change.

The full web suite and typecheck are both green on my side.

The branch is behind main, so it’ll need a rebase before merge, but I’m approving the content and i'll handle the rebase

@Maxerns
Maxerns merged commit 73a10f4 into getsotto:main Oct 14, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: retrying Cloud login loses the account-page destination

2 participants