Skip to content

Implement Frontend Wallet Session Management #5

@Iwueseiter

Description

@Iwueseiter

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:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions