Problem
The current MockAuthService in poc-frappe-api/src/AuthService.ts keeps credentials entirely in memory. This means credentials are lost whenever the app is reloaded or restarted, forcing users to re-authenticate.
Proposed Solution
Create a new StorageAuthService implementing the IAuthService interface that utilizes a storage provider to persist authentication credentials:
- Reuse or define a storage provider abstraction compatible with the existing persistence layer design.
- Implement
saveCredentials, getCredentials, and clearCredentials by serializing/deserializing the token key-pairs to persistent storage.
- Storage reads should gracefully handle missing or malformed persisted credential state.
- The implementation should remain compatible with both synchronous and asynchronous storage backends.
- Keep
MockAuthService available for tests and non-persistent environments.
Acceptance Criteria
Problem
The current
MockAuthServicein poc-frappe-api/src/AuthService.ts keeps credentials entirely in memory. This means credentials are lost whenever the app is reloaded or restarted, forcing users to re-authenticate.Proposed Solution
Create a new
StorageAuthServiceimplementing theIAuthServiceinterface that utilizes a storage provider to persist authentication credentials:saveCredentials,getCredentials, andclearCredentialsby serializing/deserializing the token key-pairs to persistent storage.MockAuthServiceavailable for tests and non-persistent environments.Acceptance Criteria
StorageAuthServiceis defined inAuthService.ts.