@thetechfossil/auth2 1.2.3 → 1.2.5

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';
@@ -7,9 +8,12 @@ interface LinkedAccount {
7
8
  avatar?: string;
8
9
  }
9
10
  interface User {
10
- _id: string;
11
+ id: string;
12
+ _id?: string;
11
13
  name: string;
12
14
  email: string;
15
+ phoneNumber?: string;
16
+ avatar?: string;
13
17
  role: string;
14
18
  linkedAccounts?: LinkedAccount[];
15
19
  createdAt: string;
@@ -23,21 +27,28 @@ interface AuthResponse {
23
27
  csrfToken?: string;
24
28
  }
25
29
  interface LoginData {
26
- email: string;
30
+ email?: string;
31
+ phoneNumber?: string;
27
32
  password?: string;
28
33
  otp?: string;
29
34
  }
30
35
  interface VerifyData {
31
- email: string;
36
+ email?: string;
37
+ phoneNumber?: string;
32
38
  otp: string;
33
39
  }
34
40
  interface RegisterData {
35
41
  name: string;
36
- email: string;
42
+ email?: string;
43
+ phoneNumber?: string;
37
44
  password: string;
38
45
  }
39
46
  interface UpdateUserData {
40
- name: string;
47
+ name?: string;
48
+ avatar?: string;
49
+ email?: string;
50
+ username?: string;
51
+ phoneNumber?: string;
41
52
  }
42
53
  type OAuthProvider = 'google' | 'github';
43
54
  interface OAuthConfig {
@@ -172,6 +183,7 @@ declare class HttpClient {
172
183
  private axiosInstance;
173
184
  private csrfToken;
174
185
  private frontendBaseUrl;
186
+ private baseUrl;
175
187
  constructor(baseUrl: string, defaultHeaders?: Record<string, string>);
176
188
  get<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
177
189
  post<T>(endpoint: string, data?: any, headers?: Record<string, string>): Promise<T>;
@@ -241,6 +253,16 @@ interface AuthProviderProps {
241
253
  declare const AuthProvider: React.FC<AuthProviderProps>;
242
254
  declare const useAuth: () => AuthContextValue;
243
255
 
256
+ type Theme = 'light' | 'dark';
257
+ interface ThemeContextType {
258
+ theme: Theme;
259
+ mounted: boolean;
260
+ }
261
+ declare function AuthThemeProvider({ children }: {
262
+ children: ReactNode;
263
+ }): react_jsx_runtime.JSX.Element;
264
+ declare function useAuthTheme(): ThemeContextType;
265
+
244
266
  interface LoginFormProps {
245
267
  onSuccess?: (response: {
246
268
  message: string;
@@ -267,6 +289,7 @@ interface RegisterFormProps {
267
289
  authConfig?: AuthConfig;
268
290
  oauthProviders?: Array<'google' | 'github'>;
269
291
  showOAuthButtons?: boolean;
292
+ invitationToken?: string | null;
270
293
  }
271
294
  declare const RegisterForm: React.FC<RegisterFormProps>;
272
295
 
@@ -274,6 +297,7 @@ interface OtpFormProps {
274
297
  email: string;
275
298
  onVerifySuccess?: () => void;
276
299
  onBackToLogin?: () => void;
300
+ baseUrl?: string;
277
301
  }
278
302
  declare const OtpForm: React.FC<OtpFormProps>;
279
303
 
@@ -403,6 +427,17 @@ interface UserProfileProps {
403
427
  }
404
428
  declare const UserProfile: React.FC<UserProfileProps>;
405
429
 
430
+ interface PhoneInputProps {
431
+ value: string;
432
+ onChange: (value: string) => void;
433
+ disabled?: boolean;
434
+ required?: boolean;
435
+ placeholder?: string;
436
+ id?: string;
437
+ style?: React.CSSProperties;
438
+ }
439
+ declare const PhoneInput: React.FC<PhoneInputProps>;
440
+
406
441
  interface UseNextAuthReturn {
407
442
  user: User | null;
408
443
  isAuthenticated: boolean;
@@ -423,4 +458,4 @@ interface UseNextAuthReturn {
423
458
  }
424
459
  declare const useNextAuth: (config: AuthConfig) => UseNextAuthReturn;
425
460
 
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 };
461
+ 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 };