Skip to content

fix(auth): clear in-memory loans on sign-out - #64

Merged
EmeditWeb merged 1 commit into
mainfrom
fix/clear-loans-on-signout
Sep 28, 2026
Merged

EmeditWeb merged 1 commit into
mainfrom
fix/clear-loans-on-signout

Conversation

@EmeditWeb

Copy link
Copy Markdown
Member

Summary

Closes #41

Sign-out cleared the wallet session, user profile, and auth tokens, but the loans store stayed populated in memory. On a shared device the next account could briefly see the previous user's loans until a refresh replaced them. This adds clearLoans() to both full sign-out paths, completing the sign-out teardown noted as the remaining follow-up on #41 (the WalletConnect-disconnect core was already resolved).

This repo is for the React Native mobile app only

This app targets learners only.
Sponsor, vendor, and mentor features belong
in StepFi-Web, not here.

Before submitting, confirm your changes belong here:

  • My changes are React Native components
    or Expo code
  • I have NOT added web-only APIs
    (window, document, localStorage)
  • I have NOT hardcoded hex color values
    (use constants/colors.ts only)
  • All icons are from lucide-react-native only
  • No API calls made directly in screen files
    (use services/ layer only)
  • Every screen has loading, error,
    and empty states

Type of change

  • Bug fix
  • New screen
  • New component
  • Service or store change
  • Navigation change
  • Performance or offline improvement

Testing

  • npx expo export --platform web passes
  • No TypeScript errors
  • Tested on Android emulator or physical device
  • No hardcoded hex colors
  • No console errors

Context files reviewed

  • context/architecture-context.md
  • context/code-standards.md

Mandatory before requesting review

This must exit 0:
npx expo export --platform web

Verified: npx expo export --platform web exits 0; tsc --noEmit clean; npm test 26/26 passing; npm run lint 0 errors.

The wallet session, user profile, and auth tokens were all cleared on
sign-out, but the loans store was left populated in memory. On a shared
device the next account would briefly see the previous user's loans
until a refresh replaced them.

Call clearLoans() alongside clearUser()/clearAuth() in both full
sign-out paths: the Settings sign-out action and the BiometricGate
lockout logout. The pre-auth wallet disconnect on the sign-in screen is
left untouched (no loans are loaded before authentication).
@EmeditWeb
EmeditWeb merged commit 894639b into main Sep 28, 2026
4 checks passed
@EmeditWeb
EmeditWeb deleted the fix/clear-loans-on-signout branch September 28, 2026 13:33
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.

fix: disconnect WalletConnect session on sign-out

1 participant