Skip to content

Wire Auth Pages to Backend API #12

Description

@aji70

Task: Wire Auth Pages to Backend API

Overview

Once login/signup UI and the API client exist, connect them to the MyFans NestJS backend (/auth/login, /auth/signup). This completes the first full-stack vertical slice.


Goals

  • Submit login/signup forms to the real API via lib/api/client
  • Store JWT access token on success (httpOnly cookie preferred; document tradeoffs if using localStorage)
  • Surface API validation errors in the form UI
  • Redirect to /dashboard (or redirect param) after successful login
  • Handle network failures gracefully with toast notifications

Deliverables

  • lib/api/auth.ts with login() and signup() functions
  • Updated auth pages using the API module
  • Token persistence helpers in lib/auth/session.ts
  • .env.example updated with correct API URL

Acceptance Criteria

  • Valid credentials from backend seed users can log in end-to-end
  • Invalid credentials show an inline error message
  • Token is available for subsequent authenticated API calls
  • Signup redirects to dashboard or login after success
  • CORS requirements documented if backend config is needed

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions