6.1 UserService Migration
Sprint Key: 6-1-user-service-migration
Epic: 6
PRD: mobile-oidc
Story 6.1: UserService Migration
As a mobile app, I want the UserService to use the new auth system instead of legacy password hashing, So that all API calls are authenticated through Keycloak tokens and legacy credential handling is eliminated.
Acceptance Criteria:
Given user_service.dart currently uses crypto for password hashing
When the migration is complete
Then hashPassword(), login(), register(), updateEmail(), deactivateAccount(), deleteAccount() are removed — all legacy auth methods (FR24)
Given the non-password methods in user_service.dart
When the migration is complete
Then getCurrentUser(), getCurrentUserInfo(), getProfile(), refreshUserData(), updateAccountSettings(), resetUserData(), checkUsernameAvailability(), checkEmailAvailability() are preserved and migrated
Given the migrated user_service.dart
When API calls are made
Then they rely on AuthInterceptor for Bearer token injection — _api.setToken() and _api.clearToken() calls are removed
Given import 'package:crypto/crypto.dart' in user_service.dart
When the migration is complete
Then the import is removed
And grep -r "package:crypto" lib/ returns no results — crypto can be safely removed from pubspec.yaml
Given api_service.dart has @Deprecated methods (setToken, clearToken, getHeaders, accessToken) and a legacy factory ApiService({AuthLogger? logger}) constructor from Story 2.2
When the migration is complete
Then all @Deprecated methods and the legacy factory constructor are removed
And // TODO(epic-6) grep markers are cleaned up
And grep -r "TODO(epic-6)" lib/ returns no results
Given file_proxy.dart calls _api.getHeaders() for multipart uploads
When the migration is complete
Then file_proxy.dart is migrated to use apiServiceProvider (Riverpod) instead of getHeaders() for Bearer token injection