Skip to content

feat(frappe-api): implement StorageAuthService for persistent credentials storage (#38)#40

Open
rohansaini-02 wants to merge 1 commit into
theapprenticeproject:mainfrom
rohansaini-02:feature/frappe-api-storage-auth-standalone-clean
Open

feat(frappe-api): implement StorageAuthService for persistent credentials storage (#38)#40
rohansaini-02 wants to merge 1 commit into
theapprenticeproject:mainfrom
rohansaini-02:feature/frappe-api-storage-auth-standalone-clean

Conversation

@rohansaini-02

Copy link
Copy Markdown

Summary

This PR implements the StorageAuthService in poc-frappe-api to persist authentication credentials using an injected storage provider interface, ensuring users stay logged in across application restarts.

Related Issue

Resolves #38

Changes Made

  • Storage Abstraction: Defined the IStorageProvider interface with support for both synchronous and asynchronous operations (getItem, setItem, removeItem).
  • Persistent Auth Service: Added StorageAuthService to serialize credentials to and from the storage provider under a custom key.
  • Robustness: Ensured storage read operations fail gracefully (returning null) when the storage is empty, fields are missing, or serialization payload is corrupted.
  • Test Coverage: Added a complete suite of unit tests in AuthService.test.ts testing the persistent storage implementation against both synchronous and asynchronous mock providers.

Testing Performed

  • Installed dependencies and ran the test runner in poc-frappe-api:
    npm test
    All 9 tests in AuthService.test.ts and FrappeClient.test.ts passed successfully.

@rohansaini-02 rohansaini-02 force-pushed the feature/frappe-api-storage-auth-standalone-clean branch from fabc212 to 6d09934 Compare May 29, 2026 11:56
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.

feat(frappe-api): implement StorageAuthService for persistent credentials storage

1 participant