@thetechfossil/auth2 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  interface LinkedAccount {
4
5
  provider: 'google' | 'github';
@@ -10,6 +11,8 @@ interface User {
10
11
  _id: string;
11
12
  name: string;
12
13
  email: string;
14
+ phoneNumber?: string;
15
+ avatar?: string;
13
16
  role: string;
14
17
  linkedAccounts?: LinkedAccount[];
15
18
  createdAt: string;
@@ -23,21 +26,28 @@ interface AuthResponse {
23
26
  csrfToken?: string;
24
27
  }
25
28
  interface LoginData {
26
- email: string;
29
+ email?: string;
30
+ phoneNumber?: string;
27
31
  password?: string;
28
32
  otp?: string;
29
33
  }
30
34
  interface VerifyData {
31
- email: string;
35
+ email?: string;
36
+ phoneNumber?: string;
32
37
  otp: string;
33
38
  }
34
39
  interface RegisterData {
35
40
  name: string;
36
- email: string;
41
+ email?: string;
42
+ phoneNumber?: string;
37
43
  password: string;
38
44
  }
39
45
  interface UpdateUserData {
40
- name: string;
46
+ name?: string;
47
+ avatar?: string;
48
+ email?: string;
49
+ username?: string;
50
+ phoneNumber?: string;
41
51
  }
42
52
  type OAuthProvider = 'google' | 'github';
43
53
  interface OAuthConfig {
@@ -172,6 +182,7 @@ declare class HttpClient {
172
182
  private axiosInstance;
173
183
  private csrfToken;
174
184
  private frontendBaseUrl;
185
+ private baseUrl;
175
186
  constructor(baseUrl: string, defaultHeaders?: Record<string, string>);
176
187
  get<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
177
188
  post<T>(endpoint: string, data?: any, headers?: Record<string, string>): Promise<T>;
@@ -241,6 +252,16 @@ interface AuthProviderProps {
241
252
  declare const AuthProvider: React.FC<AuthProviderProps>;
242
253
  declare const useAuth: () => AuthContextValue;
243
254
 
255
+ type Theme = 'light' | 'dark';
256
+ interface ThemeContextType {
257
+ theme: Theme;
258
+ mounted: boolean;
259
+ }
260
+ declare function AuthThemeProvider({ children }: {
261
+ children: ReactNode;
262
+ }): react_jsx_runtime.JSX.Element;
263
+ declare function useAuthTheme(): ThemeContextType;
264
+
244
265
  interface LoginFormProps {
245
266
  onSuccess?: (response: {
246
267
  message: string;
@@ -267,6 +288,7 @@ interface RegisterFormProps {
267
288
  authConfig?: AuthConfig;
268
289
  oauthProviders?: Array<'google' | 'github'>;
269
290
  showOAuthButtons?: boolean;
291
+ invitationToken?: string | null;
270
292
  }
271
293
  declare const RegisterForm: React.FC<RegisterFormProps>;
272
294
 
@@ -274,6 +296,7 @@ interface OtpFormProps {
274
296
  email: string;
275
297
  onVerifySuccess?: () => void;
276
298
  onBackToLogin?: () => void;
299
+ baseUrl?: string;
277
300
  }
278
301
  declare const OtpForm: React.FC<OtpFormProps>;
279
302
 
@@ -403,6 +426,17 @@ interface UserProfileProps {
403
426
  }
404
427
  declare const UserProfile: React.FC<UserProfileProps>;
405
428
 
429
+ interface PhoneInputProps {
430
+ value: string;
431
+ onChange: (value: string) => void;
432
+ disabled?: boolean;
433
+ required?: boolean;
434
+ placeholder?: string;
435
+ id?: string;
436
+ style?: React.CSSProperties;
437
+ }
438
+ declare const PhoneInput: React.FC<PhoneInputProps>;
439
+
406
440
  interface UseNextAuthReturn {
407
441
  user: User | null;
408
442
  isAuthenticated: boolean;
@@ -423,4 +457,4 @@ interface UseNextAuthReturn {
423
457
  }
424
458
  declare const useNextAuth: (config: AuthConfig) => UseNextAuthReturn;
425
459
 
426
- export { AuditLog, AuthConfig, AuthFlow, AuthProvider, AuthResponse, AuthService, ChangePassword, CsrfTokenResponse, EmailVerificationPage, ForgotPassword, HttpClient, LinkedAccount, LoginData, LoginForm, MFASetup, OAuthConfig, OAuthProvider, OtpForm, ProtectedRoute, PublicRoute, RegisterData, RegisterForm, ResetPassword, Session, SignIn, SignOut, SignUp, UpdateUserData, UseAuthReturn, User, UserButton, UserProfile, VerifyData, VerifyEmail, useAuth, useAuth$1 as useAuthLegacy, useNextAuth };
460
+ export { AuditLog, AuthConfig, AuthFlow, AuthProvider, AuthResponse, AuthService, AuthThemeProvider, ChangePassword, CsrfTokenResponse, EmailVerificationPage, ForgotPassword, HttpClient, LinkedAccount, LoginData, LoginForm, MFASetup, OAuthConfig, OAuthProvider, OtpForm, PhoneInput, ProtectedRoute, PublicRoute, RegisterData, RegisterForm, RegisterFormProps, ResetPassword, Session, SignIn, SignOut, SignUp, UpdateUserData, UseAuthReturn, User, UserButton, UserProfile, VerifyData, VerifyEmail, useAuth, useAuth$1 as useAuthLegacy, useAuthTheme, useNextAuth };