Skip to content

fix(account): stop signing in deactivated accounts - #14580

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/deactivated-account-login
Aug 28, 2026
Merged

fix(account): stop signing in deactivated accounts#14580
dylanjeffers merged 1 commit into
mainfrom
fix/deactivated-account-login

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Description

A user who deactivated their account (audius.co/timitamminen, is_deactivated: true in prod) reported they can still log in, and sent a screenshot of their own feed from "inside my deactivated account".

Two things combine:

  1. fetchAccountAsync is missing a return. It detects the deactivated account, dispatches resetAccount() + fetchAccountFailed({ reason: 'ACCOUNT_DEACTIVATED' }), and then falls straight through to setLocalStorageAccountAndUser, fetchAccountSucceeded and signedIn. The account is fully restored — and written to local storage — despite the "failure". The return was present in the old packages/web/src/common/store/account/sagas.js and was dropped when the saga was ported to TS in [C-5416] Basic guest checkout behind feature flag #10447 (Nov 2024). The sibling cached path fetchLocalAccountAsync still guards correctly, which is why this only bites on the network path.

  2. The sign-in saga leaves the hedgehog session live. signIn correctly detects is_deactivated and toasts, but by then authService.signIn has already persisted the wallet. A page refresh then runs fetchAccountAsync, hits (1), and signs the user in. Now calls authService.signOut before bailing.

packages/common is shared, so this affected both web and mobile.

Tests

Adds packages/common/src/store/account/sagas.test.ts — asserts a deactivated account produces fetchAccountFailed and never fetchAccountSucceeded/signedIn. Verified it fails with the return removed.

How to test

  1. Deactivate a test account.
  2. Sign in with it — expect the "account deactivated" toast.
  3. Reload the page. Before: signed into the feed. After: still signed out.

🤖 Generated with Claude Code

fetchAccountAsync detected a deactivated account, dispatched resetAccount
and fetchAccountFailed({ reason: 'ACCOUNT_DEACTIVATED' }), then fell
through to setLocalStorageAccountAndUser, fetchAccountSucceeded and
signedIn — so the account was fully restored (and cached) anyway. The
`return` existed in the old JS saga and was dropped in the JS -> TS port
in #10447.

The sign-in form's own check does block, but it left the hedgehog session
from the login intact, so reloading the page ran fetchAccountAsync and
signed the user straight in. Clear the session there too.

Affects web and mobile (shared saga). Reported by a deactivated user who
sent a screenshot of their own feed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8755235

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers
dylanjeffers merged commit 41a019e into main Aug 28, 2026
17 checks passed
@dylanjeffers
dylanjeffers deleted the fix/deactivated-account-login branch August 28, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant