Files
halobestie-clone/mitra_app/pubspec.yaml
ramadhan sjamsani 2b61c79a86 Phase 3.4: mitra_app self-managed auth cutover
Rips firebase_auth; phone OTP flow now talks directly to the new
backend endpoints, JWT access token lives in memory, refresh token
persists via flutter_secure_storage. WebSocket handshakes read the
access token from AuthBridge instead of Firebase.

Smoke-tested end-to-end against the backend via curl:
- otp/request → read stub code from backend log → otp/verify
- /api/mitra/auth/me + /api/shared/auth/refresh rotation
- logout → post-logout refresh correctly fails REFRESH_INVALID
- ACCOUNT_INACTIVE (403) + WRONG_FLOW (400) error paths verified
- Debug APK links cleanly

- pubspec: drop firebase_auth, add flutter_secure_storage
- core/auth/auth_bridge.dart: shared mutable state (access token +
  refresh callback + in-flight de-dup) as keepAlive provider
- core/auth/token_storage.dart: flutter_secure_storage wrapper
- core/auth/auth_notifier.dart: bootstrap → refresh; requestOtp +
  verifyOtp via /api/mitra/auth/*; logout; granular OTP error codes
- core/api/api_client.dart: Bearer from bridge + postRaw(skipAuth) for
  auth endpoints + single-retry 401 refresh
- core/chat/*_notifier.dart: WS auth frame reads bridge.accessToken
- features/auth/screens/otp_screen.dart: verificationId → otpRequestId
- mitra_app/CLAUDE.md: Auth section rewritten (was stale on Firebase)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 15:58:25 +08:00

49 lines
931 B
YAML

name: mitra_app
description: Halo Bestie - Mitra App
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=3.0.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
# Firebase (Messaging only — Auth dropped in Phase 3.4, self-managed JWT now)
firebase_core: ^2.27.1
firebase_messaging: ^14.7.15
# Secure token storage (refresh + access)
flutter_secure_storage: ^9.2.2
# HTTP & WebSocket
dio: ^5.4.3
web_socket_channel: ^2.4.5
# State management
flutter_riverpod: ^2.6.1
hooks_riverpod: ^2.6.1
riverpod_annotation: ^2.6.1
flutter_hooks: ^0.20.5
# Navigation
go_router: ^13.2.1
flutter_local_notifications: ^21.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.0
riverpod_generator: ^2.6.2
build_runner: ^2.4.13
custom_lint: ^0.7.0
riverpod_lint: ^2.6.2
flutter:
uses-material-design: true
assets:
- assets/images/
- assets/images/splash/