@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.
- package/dist/index.components.d.ts +14 -1
- package/dist/index.components.js +1284 -638
- package/dist/index.components.js.map +1 -1
- package/dist/index.components.mjs +1186 -543
- package/dist/index.components.mjs.map +1 -1
- package/dist/index.d.ts +48 -5
- package/dist/index.js +1364 -669
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1237 -544
- package/dist/index.mjs.map +1 -1
- package/dist/index.next.d.ts +41 -6
- package/dist/index.next.js +1382 -687
- package/dist/index.next.js.map +1 -1
- package/dist/index.next.mjs +1234 -544
- package/dist/index.next.mjs.map +1 -1
- package/dist/index.next.server.d.ts +16 -5
- package/dist/index.next.server.js +16 -9
- package/dist/index.next.server.js.map +1 -1
- package/dist/index.next.server.mjs +16 -9
- package/dist/index.next.server.mjs.map +1 -1
- package/dist/index.node.d.ts +16 -5
- package/dist/index.node.js +15 -9
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +15 -9
- package/dist/index.node.mjs.map +1 -1
- package/package.json +90 -87
- package/README.NEW.md +0 -365
package/dist/index.next.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
30
|
+
email?: string;
|
|
31
|
+
phoneNumber?: string;
|
|
27
32
|
password?: string;
|
|
28
33
|
otp?: string;
|
|
29
34
|
}
|
|
30
35
|
interface VerifyData {
|
|
31
|
-
email
|
|
36
|
+
email?: string;
|
|
37
|
+
phoneNumber?: string;
|
|
32
38
|
otp: string;
|
|
33
39
|
}
|
|
34
40
|
interface RegisterData {
|
|
35
41
|
name: string;
|
|
36
|
-
email
|
|
42
|
+
email?: string;
|
|
43
|
+
phoneNumber?: string;
|
|
37
44
|
password: string;
|
|
38
45
|
}
|
|
39
46
|
interface UpdateUserData {
|
|
40
|
-
name
|
|
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 };
|