-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Description
Implement a frontend session system that treats a connected Stellar wallet as the authenticated user and persists the session across page reloads.
Since the backend is not ready, the wallet public key will temporarily serve as the user session. The structure must be modular to allow easy integration with backend authentication later.
Tasks
Session Service
Create:/services/auth/session.service.ts
Implement:
-
createSession(publicKey)
-
getSession()
-
clearSession()
-
isAuthenticated()
-
Store session in localStorage.
-
Auth Context
Create:/context/auth.context.tsx
Add:
-
publicKey
-
isAuthenticated
-
login(publicKey)
-
logout()
-
Restore session on app load
Integration
-
Create session when wallet connects
-
Restore session on refresh
-
Clear session on logout
Acceptance Criteria
-
User remains logged in after refresh
-
Session stored and restored correctly
-
Logout clears session
-
Auth state available globally
-
No backend required
Dependency
Requires:
-
Wallet Connection Logic Implement Wallet Connection Logic (Freighter) #3
-
Wallet Context Create Wallet Context for global wallet state management #4