auth.ts

Authentication API service for user login and JWT token handling.

Responsibilities:

  • Handle user login requests to the backend
  • Extract and decode JWT tokens from responses
  • Parse user role from JWT payload
  • Error handling and validation

Security Notes:

  • JWT tokens are decoded client-side (payload only, signature verification via backend)
  • Passwords are never logged or stored locally
  • Token should be stored securely (HttpOnly cookies preferred, localStorage fallback)

../services/apiClient

Index

Functions