From e6585ba0d57db901e73bf20534d1ff155b7d2b1e Mon Sep 17 00:00:00 2001 From: "Siddhant P. Pardeshi" Date: Sun, 10 Nov 2024 18:57:39 -0500 Subject: [PATCH] Add public-samples/mint-mobile-app-fq9nqt/src/web/src/types/auth.types.ts --- src/web/src/types/auth.types.ts | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/web/src/types/auth.types.ts diff --git a/src/web/src/types/auth.types.ts b/src/web/src/types/auth.types.ts new file mode 100644 index 0000000..3809856 --- /dev/null +++ b/src/web/src/types/auth.types.ts @@ -0,0 +1,74 @@ +/** + * Human Tasks: + * 1. Ensure JWT token secret is properly configured in environment variables + * 2. Configure token expiration times in environment settings + * 3. Set up secure password requirements in validation constants + */ + +/** + * Authentication type definitions for Mint Replica Lite web application + * + * Requirements addressed: + * - Technical Specification/9.1.1 Authentication Methods: Email/password authentication with JWT tokens + * - Technical Specification/9.1.3 Session Management: JWT token and session state management types + * - Technical Specification/8.4.1 Authentication Flow: Types for login, registration, and token refresh + */ + +/** + * Interface representing login request credentials + */ +export interface LoginCredentials { + email: string; + password: string; +} + +/** + * Interface representing registration request credentials + */ +export interface RegisterCredentials { + email: string; + password: string; + firstName: string; + lastName: string; +} + +/** + * Interface representing user data + */ +export interface User { + id: string; + email: string; + firstName: string; + lastName: string; + createdAt: string; + updatedAt: string; +} + +/** + * Interface representing the authentication state + * Used for managing the user's authentication status and tokens + */ +export interface AuthState { + isAuthenticated: boolean; + user: User | null; + accessToken: string | null; + refreshToken: string | null; +} + +/** + * Interface representing authentication API responses + * Used for handling login, registration, and token refresh responses + */ +export interface AuthResponse { + user: User; + accessToken: string; + refreshToken: string; +} + +/** + * Interface representing password reset request credentials + */ +export interface PasswordResetCredentials { + token: string; + newPassword: string; +} \ No newline at end of file