Skip to content

fix: update stale account url/email on re-login#18426

Merged
kitlangton merged 1 commit intodevfrom
worktree-fix-stale-account-url
Mar 20, 2026
Merged

fix: update stale account url/email on re-login#18426
kitlangton merged 1 commit intodevfrom
worktree-fix-stale-account-url

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • persistAccount() upsert only updated tokens on conflict, leaving stale email and url values from previous environments
  • This caused re-login against a new server to keep using the old server URL for token refresh, leading to 400 errors
  • Now updates all server-owned fields (email, url, tokens, expiry) on conflict

Test plan

  • Log in with an account that has a stale URL in the DB
  • Verify the account row's url and email are updated after re-login
  • Verify token refresh uses the new URL

The persistAccount upsert only updated tokens on conflict,
leaving stale email/url values from previous environments.
This caused login against a new server to keep using the old
server URL for token refresh.
@kitlangton kitlangton marked this pull request as ready for review March 20, 2026 18:49
@kitlangton kitlangton merged commit 24f9df5 into dev Mar 20, 2026
11 checks passed
@kitlangton kitlangton deleted the worktree-fix-stale-account-url branch March 20, 2026 18:50
HacknBashe pushed a commit to HacknBashe/opencode that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant