@insforge/nextjs 0.6.7 → 0.6.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/nextjs",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "Pre-built authentication UI components for Next.js with Insforge backend - zero configuration required",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/dist/api.d.mts DELETED
@@ -1,50 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- interface AuthRouteConfig {
4
- baseUrl: string;
5
- cookieName?: string;
6
- cookieMaxAge?: number;
7
- secure?: boolean;
8
- }
9
- declare function createAuthRouteHandlers(config: AuthRouteConfig): {
10
- POST: (request: NextRequest) => Promise<NextResponse<{
11
- error: string;
12
- }> | NextResponse<{
13
- user: any;
14
- session: {
15
- userId: any;
16
- expiresAt: string;
17
- createdAt: string;
18
- };
19
- }>>;
20
- GET: (request: NextRequest) => Promise<NextResponse<{
21
- user: null;
22
- session: null;
23
- }> | NextResponse<{
24
- user: any;
25
- session: {
26
- userId: any;
27
- token: string;
28
- expiresAt: string;
29
- createdAt: string;
30
- };
31
- }>>;
32
- DELETE: (request: NextRequest) => Promise<NextResponse<{
33
- success: boolean;
34
- }> | NextResponse<{
35
- error: string;
36
- }>>;
37
- };
38
-
39
- interface ProfileHandlerConfig {
40
- baseUrl: string;
41
- }
42
- declare function createProfileHandler(config: ProfileHandlerConfig): (request: NextRequest) => Promise<NextResponse<{
43
- success: boolean;
44
- error: string;
45
- }> | NextResponse<{
46
- success: boolean;
47
- user: any;
48
- }>>;
49
-
50
- export { type AuthRouteConfig, type ProfileHandlerConfig, createAuthRouteHandlers, createProfileHandler };
package/dist/api.d.ts DELETED
@@ -1,50 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- interface AuthRouteConfig {
4
- baseUrl: string;
5
- cookieName?: string;
6
- cookieMaxAge?: number;
7
- secure?: boolean;
8
- }
9
- declare function createAuthRouteHandlers(config: AuthRouteConfig): {
10
- POST: (request: NextRequest) => Promise<NextResponse<{
11
- error: string;
12
- }> | NextResponse<{
13
- user: any;
14
- session: {
15
- userId: any;
16
- expiresAt: string;
17
- createdAt: string;
18
- };
19
- }>>;
20
- GET: (request: NextRequest) => Promise<NextResponse<{
21
- user: null;
22
- session: null;
23
- }> | NextResponse<{
24
- user: any;
25
- session: {
26
- userId: any;
27
- token: string;
28
- expiresAt: string;
29
- createdAt: string;
30
- };
31
- }>>;
32
- DELETE: (request: NextRequest) => Promise<NextResponse<{
33
- success: boolean;
34
- }> | NextResponse<{
35
- error: string;
36
- }>>;
37
- };
38
-
39
- interface ProfileHandlerConfig {
40
- baseUrl: string;
41
- }
42
- declare function createProfileHandler(config: ProfileHandlerConfig): (request: NextRequest) => Promise<NextResponse<{
43
- success: boolean;
44
- error: string;
45
- }> | NextResponse<{
46
- success: boolean;
47
- user: any;
48
- }>>;
49
-
50
- export { type AuthRouteConfig, type ProfileHandlerConfig, createAuthRouteHandlers, createProfileHandler };
package/dist/index.d.mts DELETED
@@ -1,258 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import { ReactNode, CSSProperties, InputHTMLAttributes } from 'react';
4
-
5
- interface InsforgeUser {
6
- id: string;
7
- email: string;
8
- avatar_url?: string;
9
- nickname?: string;
10
- bio?: string;
11
- birthday?: string;
12
- createdAt: string;
13
- updatedAt: string;
14
- [key: string]: any;
15
- }
16
- interface InsforgeSession {
17
- userId: string;
18
- token: string;
19
- expiresAt: string;
20
- createdAt: string;
21
- }
22
- interface SignInProps {
23
- afterSignInUrl?: string;
24
- appearance?: {
25
- container?: React.CSSProperties;
26
- form?: React.CSSProperties;
27
- button?: React.CSSProperties;
28
- };
29
- title?: string;
30
- subtitle?: string;
31
- emailLabel?: string;
32
- emailPlaceholder?: string;
33
- passwordLabel?: string;
34
- passwordPlaceholder?: string;
35
- forgotPasswordText?: string;
36
- submitButtonText?: string;
37
- loadingButtonText?: string;
38
- signUpText?: string;
39
- signUpLinkText?: string;
40
- signUpUrl?: string;
41
- dividerText?: string;
42
- onSuccess?: (user: InsforgeUser) => void;
43
- onError?: (error: Error) => void;
44
- }
45
- interface SignUpProps {
46
- afterSignUpUrl?: string;
47
- appearance?: {
48
- container?: React.CSSProperties;
49
- form?: React.CSSProperties;
50
- button?: React.CSSProperties;
51
- };
52
- title?: string;
53
- subtitle?: string;
54
- emailLabel?: string;
55
- emailPlaceholder?: string;
56
- passwordLabel?: string;
57
- passwordPlaceholder?: string;
58
- submitButtonText?: string;
59
- loadingButtonText?: string;
60
- verifyButtonText?: string;
61
- loadingVerifyButtonText?: string;
62
- verifiedButtonText?: string;
63
- signInText?: string;
64
- signInLinkText?: string;
65
- signInUrl?: string;
66
- dividerText?: string;
67
- onSuccess?: (user: InsforgeUser) => void;
68
- onError?: (error: Error) => void;
69
- }
70
- interface UserButtonProps {
71
- afterSignOutUrl?: string;
72
- mode?: 'detailed' | 'simple';
73
- appearance?: {
74
- button?: React.CSSProperties;
75
- dropdown?: React.CSSProperties;
76
- };
77
- }
78
- interface ProtectProps {
79
- children: ReactNode;
80
- fallback?: ReactNode;
81
- redirectTo?: string;
82
- condition?: (user: InsforgeUser) => boolean;
83
- }
84
- interface ConditionalProps {
85
- children: ReactNode;
86
- }
87
- type OAuthProvider = 'google' | 'github' | 'discord' | 'facebook' | 'linkedin' | 'instagram' | 'tiktok' | 'apple' | 'x' | 'spotify' | 'microsoft';
88
- interface OAuthProviderConfig {
89
- name: string;
90
- svg: JSX.Element;
91
- className: string;
92
- }
93
-
94
- interface InsforgeContextValue {
95
- user: InsforgeUser | null;
96
- session: InsforgeSession | null;
97
- isLoaded: boolean;
98
- isSignedIn: boolean;
99
- setUser: (user: InsforgeUser | null) => void;
100
- signIn: (email: string, password: string) => Promise<void>;
101
- signUp: (email: string, password: string) => Promise<void>;
102
- signOut: () => Promise<void>;
103
- updateUser: (data: Partial<InsforgeUser>) => Promise<void>;
104
- sendVerificationCode: (email: string, type: 'signup' | 'signin') => Promise<void>;
105
- verifySignUpCode: (email: string, password: string, code: string) => Promise<void>;
106
- verifySignInCode: (email: string, code: string) => Promise<void>;
107
- oauthProviders: OAuthProvider[];
108
- isConfigLoaded: boolean;
109
- baseUrl: string;
110
- }
111
- interface InsforgeProviderProps {
112
- children: ReactNode;
113
- baseUrl: string;
114
- frontendUrl?: string;
115
- onAuthChange?: (user: InsforgeUser | null) => void;
116
- useBuiltInAuth?: boolean;
117
- }
118
- declare function InsforgeProvider({ children, baseUrl, frontendUrl, onAuthChange, useBuiltInAuth }: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
119
- declare function useInsforge(): InsforgeContextValue;
120
-
121
- declare function useAuth(): {
122
- signIn: (email: string, password: string) => Promise<void>;
123
- signUp: (email: string, password: string) => Promise<void>;
124
- signOut: () => Promise<void>;
125
- isLoaded: boolean;
126
- isSignedIn: boolean;
127
- };
128
-
129
- declare function useUser(): {
130
- user: InsforgeUser | null;
131
- isLoaded: boolean;
132
- updateUser: (data: Partial<InsforgeUser>) => Promise<void>;
133
- setUser: (user: InsforgeUser | null) => void;
134
- };
135
-
136
- declare function useSession(): {
137
- session: InsforgeSession | null;
138
- isLoaded: boolean;
139
- };
140
-
141
- declare function useOAuthProviders(): {
142
- providers: OAuthProvider[];
143
- isLoaded: boolean;
144
- };
145
-
146
- declare function SignIn({ afterSignInUrl, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, onSuccess, onError, }: SignInProps): react_jsx_runtime.JSX.Element;
147
-
148
- declare function SignUp({ afterSignUpUrl, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, verifyButtonText, loadingVerifyButtonText, verifiedButtonText, signInText, signInLinkText, signInUrl, dividerText, onSuccess, onError, }: SignUpProps): react_jsx_runtime.JSX.Element;
149
-
150
- declare function UserButton({ afterSignOutUrl, mode, appearance, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
151
-
152
- declare function SignedIn({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
153
-
154
- declare function SignedOut({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
155
-
156
- declare function Protect({ children, fallback, redirectTo, condition, }: ProtectProps): string | number | bigint | true | Iterable<react.ReactNode> | Promise<react.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null;
157
-
158
- interface AuthContainerProps {
159
- children: ReactNode;
160
- style?: CSSProperties;
161
- }
162
- declare function AuthContainer({ children, style }: AuthContainerProps): react_jsx_runtime.JSX.Element;
163
-
164
- interface AuthHeaderProps {
165
- title: string;
166
- subtitle?: string;
167
- }
168
- declare function AuthHeader({ title, subtitle }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
169
-
170
- interface AuthErrorBannerProps {
171
- error: string;
172
- }
173
- declare function AuthErrorBanner({ error }: AuthErrorBannerProps): react_jsx_runtime.JSX.Element | null;
174
-
175
- interface AuthFormFieldProps extends InputHTMLAttributes<HTMLInputElement> {
176
- label: string;
177
- id: string;
178
- }
179
- declare function AuthFormField({ label, id, className, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
180
-
181
- interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
182
- label: string;
183
- id: string;
184
- showStrengthIndicator?: boolean;
185
- forgotPasswordLink?: {
186
- href: string;
187
- text?: string;
188
- };
189
- }
190
- declare function AuthPasswordField({ label, id, showStrengthIndicator, forgotPasswordLink, value, className, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
191
-
192
- interface AuthSubmitButtonProps {
193
- children: ReactNode;
194
- isLoading?: boolean;
195
- confirmed?: boolean;
196
- disabled?: boolean;
197
- style?: CSSProperties;
198
- }
199
- declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, style, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
200
-
201
- interface AuthDividerProps {
202
- text?: string;
203
- }
204
- declare function AuthDivider({ text }: AuthDividerProps): react_jsx_runtime.JSX.Element;
205
-
206
- interface AuthLinkProps {
207
- text: string;
208
- linkText: string;
209
- href: string;
210
- }
211
- declare function AuthLink({ text, linkText, href }: AuthLinkProps): react_jsx_runtime.JSX.Element;
212
-
213
- interface AuthOAuthProvidersProps {
214
- providers: OAuthProvider[];
215
- onClick: (provider: OAuthProvider) => void;
216
- disabled?: boolean;
217
- loading: OAuthProvider | null;
218
- }
219
- declare function AuthOAuthProviders({ providers, onClick, disabled, loading, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
220
-
221
- interface AuthBrandingProps {
222
- text?: string;
223
- href?: string;
224
- }
225
- declare function AuthBranding({ text, href }: AuthBrandingProps): react_jsx_runtime.JSX.Element;
226
-
227
- type DisplayMode = 'full' | 'short' | 'icon';
228
- interface AuthOAuthButtonProps {
229
- provider: OAuthProvider;
230
- onClick: (provider: OAuthProvider) => void;
231
- disabled?: boolean;
232
- loading?: boolean;
233
- displayMode?: DisplayMode;
234
- style?: React.CSSProperties;
235
- }
236
- declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
237
-
238
- interface AuthPasswordStrengthIndicatorProps {
239
- password: string;
240
- }
241
- declare function validatePasswordStrength(password: string): boolean;
242
- declare function AuthPasswordStrengthIndicator({ password }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
243
-
244
- interface AuthVerificationCodeInputProps {
245
- length?: number;
246
- value: string;
247
- email: string;
248
- onChange: (value: string) => void;
249
- disabled?: boolean;
250
- }
251
- declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
252
-
253
- declare const OAUTH_PROVIDER_CONFIG: Record<OAuthProvider, OAuthProviderConfig>;
254
- declare function getProviderConfig(provider: OAuthProvider): OAuthProviderConfig | null;
255
- declare function getProviderName(provider: OAuthProvider): string;
256
- declare function isProviderSupported(provider: string): provider is OAuthProvider;
257
-
258
- export { AuthBranding, AuthContainer, AuthDivider, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput, type ConditionalProps, InsforgeProvider, type InsforgeSession, type InsforgeUser, OAUTH_PROVIDER_CONFIG, type OAuthProvider, type OAuthProviderConfig, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, getProviderConfig, getProviderName, isProviderSupported, useAuth, useInsforge, useOAuthProviders, useSession, useUser, validatePasswordStrength };
package/dist/index.d.ts DELETED
@@ -1,258 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import { ReactNode, CSSProperties, InputHTMLAttributes } from 'react';
4
-
5
- interface InsforgeUser {
6
- id: string;
7
- email: string;
8
- avatar_url?: string;
9
- nickname?: string;
10
- bio?: string;
11
- birthday?: string;
12
- createdAt: string;
13
- updatedAt: string;
14
- [key: string]: any;
15
- }
16
- interface InsforgeSession {
17
- userId: string;
18
- token: string;
19
- expiresAt: string;
20
- createdAt: string;
21
- }
22
- interface SignInProps {
23
- afterSignInUrl?: string;
24
- appearance?: {
25
- container?: React.CSSProperties;
26
- form?: React.CSSProperties;
27
- button?: React.CSSProperties;
28
- };
29
- title?: string;
30
- subtitle?: string;
31
- emailLabel?: string;
32
- emailPlaceholder?: string;
33
- passwordLabel?: string;
34
- passwordPlaceholder?: string;
35
- forgotPasswordText?: string;
36
- submitButtonText?: string;
37
- loadingButtonText?: string;
38
- signUpText?: string;
39
- signUpLinkText?: string;
40
- signUpUrl?: string;
41
- dividerText?: string;
42
- onSuccess?: (user: InsforgeUser) => void;
43
- onError?: (error: Error) => void;
44
- }
45
- interface SignUpProps {
46
- afterSignUpUrl?: string;
47
- appearance?: {
48
- container?: React.CSSProperties;
49
- form?: React.CSSProperties;
50
- button?: React.CSSProperties;
51
- };
52
- title?: string;
53
- subtitle?: string;
54
- emailLabel?: string;
55
- emailPlaceholder?: string;
56
- passwordLabel?: string;
57
- passwordPlaceholder?: string;
58
- submitButtonText?: string;
59
- loadingButtonText?: string;
60
- verifyButtonText?: string;
61
- loadingVerifyButtonText?: string;
62
- verifiedButtonText?: string;
63
- signInText?: string;
64
- signInLinkText?: string;
65
- signInUrl?: string;
66
- dividerText?: string;
67
- onSuccess?: (user: InsforgeUser) => void;
68
- onError?: (error: Error) => void;
69
- }
70
- interface UserButtonProps {
71
- afterSignOutUrl?: string;
72
- mode?: 'detailed' | 'simple';
73
- appearance?: {
74
- button?: React.CSSProperties;
75
- dropdown?: React.CSSProperties;
76
- };
77
- }
78
- interface ProtectProps {
79
- children: ReactNode;
80
- fallback?: ReactNode;
81
- redirectTo?: string;
82
- condition?: (user: InsforgeUser) => boolean;
83
- }
84
- interface ConditionalProps {
85
- children: ReactNode;
86
- }
87
- type OAuthProvider = 'google' | 'github' | 'discord' | 'facebook' | 'linkedin' | 'instagram' | 'tiktok' | 'apple' | 'x' | 'spotify' | 'microsoft';
88
- interface OAuthProviderConfig {
89
- name: string;
90
- svg: JSX.Element;
91
- className: string;
92
- }
93
-
94
- interface InsforgeContextValue {
95
- user: InsforgeUser | null;
96
- session: InsforgeSession | null;
97
- isLoaded: boolean;
98
- isSignedIn: boolean;
99
- setUser: (user: InsforgeUser | null) => void;
100
- signIn: (email: string, password: string) => Promise<void>;
101
- signUp: (email: string, password: string) => Promise<void>;
102
- signOut: () => Promise<void>;
103
- updateUser: (data: Partial<InsforgeUser>) => Promise<void>;
104
- sendVerificationCode: (email: string, type: 'signup' | 'signin') => Promise<void>;
105
- verifySignUpCode: (email: string, password: string, code: string) => Promise<void>;
106
- verifySignInCode: (email: string, code: string) => Promise<void>;
107
- oauthProviders: OAuthProvider[];
108
- isConfigLoaded: boolean;
109
- baseUrl: string;
110
- }
111
- interface InsforgeProviderProps {
112
- children: ReactNode;
113
- baseUrl: string;
114
- frontendUrl?: string;
115
- onAuthChange?: (user: InsforgeUser | null) => void;
116
- useBuiltInAuth?: boolean;
117
- }
118
- declare function InsforgeProvider({ children, baseUrl, frontendUrl, onAuthChange, useBuiltInAuth }: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
119
- declare function useInsforge(): InsforgeContextValue;
120
-
121
- declare function useAuth(): {
122
- signIn: (email: string, password: string) => Promise<void>;
123
- signUp: (email: string, password: string) => Promise<void>;
124
- signOut: () => Promise<void>;
125
- isLoaded: boolean;
126
- isSignedIn: boolean;
127
- };
128
-
129
- declare function useUser(): {
130
- user: InsforgeUser | null;
131
- isLoaded: boolean;
132
- updateUser: (data: Partial<InsforgeUser>) => Promise<void>;
133
- setUser: (user: InsforgeUser | null) => void;
134
- };
135
-
136
- declare function useSession(): {
137
- session: InsforgeSession | null;
138
- isLoaded: boolean;
139
- };
140
-
141
- declare function useOAuthProviders(): {
142
- providers: OAuthProvider[];
143
- isLoaded: boolean;
144
- };
145
-
146
- declare function SignIn({ afterSignInUrl, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, onSuccess, onError, }: SignInProps): react_jsx_runtime.JSX.Element;
147
-
148
- declare function SignUp({ afterSignUpUrl, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, verifyButtonText, loadingVerifyButtonText, verifiedButtonText, signInText, signInLinkText, signInUrl, dividerText, onSuccess, onError, }: SignUpProps): react_jsx_runtime.JSX.Element;
149
-
150
- declare function UserButton({ afterSignOutUrl, mode, appearance, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
151
-
152
- declare function SignedIn({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
153
-
154
- declare function SignedOut({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
155
-
156
- declare function Protect({ children, fallback, redirectTo, condition, }: ProtectProps): string | number | bigint | true | Iterable<react.ReactNode> | Promise<react.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null;
157
-
158
- interface AuthContainerProps {
159
- children: ReactNode;
160
- style?: CSSProperties;
161
- }
162
- declare function AuthContainer({ children, style }: AuthContainerProps): react_jsx_runtime.JSX.Element;
163
-
164
- interface AuthHeaderProps {
165
- title: string;
166
- subtitle?: string;
167
- }
168
- declare function AuthHeader({ title, subtitle }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
169
-
170
- interface AuthErrorBannerProps {
171
- error: string;
172
- }
173
- declare function AuthErrorBanner({ error }: AuthErrorBannerProps): react_jsx_runtime.JSX.Element | null;
174
-
175
- interface AuthFormFieldProps extends InputHTMLAttributes<HTMLInputElement> {
176
- label: string;
177
- id: string;
178
- }
179
- declare function AuthFormField({ label, id, className, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
180
-
181
- interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
182
- label: string;
183
- id: string;
184
- showStrengthIndicator?: boolean;
185
- forgotPasswordLink?: {
186
- href: string;
187
- text?: string;
188
- };
189
- }
190
- declare function AuthPasswordField({ label, id, showStrengthIndicator, forgotPasswordLink, value, className, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
191
-
192
- interface AuthSubmitButtonProps {
193
- children: ReactNode;
194
- isLoading?: boolean;
195
- confirmed?: boolean;
196
- disabled?: boolean;
197
- style?: CSSProperties;
198
- }
199
- declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, style, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
200
-
201
- interface AuthDividerProps {
202
- text?: string;
203
- }
204
- declare function AuthDivider({ text }: AuthDividerProps): react_jsx_runtime.JSX.Element;
205
-
206
- interface AuthLinkProps {
207
- text: string;
208
- linkText: string;
209
- href: string;
210
- }
211
- declare function AuthLink({ text, linkText, href }: AuthLinkProps): react_jsx_runtime.JSX.Element;
212
-
213
- interface AuthOAuthProvidersProps {
214
- providers: OAuthProvider[];
215
- onClick: (provider: OAuthProvider) => void;
216
- disabled?: boolean;
217
- loading: OAuthProvider | null;
218
- }
219
- declare function AuthOAuthProviders({ providers, onClick, disabled, loading, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
220
-
221
- interface AuthBrandingProps {
222
- text?: string;
223
- href?: string;
224
- }
225
- declare function AuthBranding({ text, href }: AuthBrandingProps): react_jsx_runtime.JSX.Element;
226
-
227
- type DisplayMode = 'full' | 'short' | 'icon';
228
- interface AuthOAuthButtonProps {
229
- provider: OAuthProvider;
230
- onClick: (provider: OAuthProvider) => void;
231
- disabled?: boolean;
232
- loading?: boolean;
233
- displayMode?: DisplayMode;
234
- style?: React.CSSProperties;
235
- }
236
- declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
237
-
238
- interface AuthPasswordStrengthIndicatorProps {
239
- password: string;
240
- }
241
- declare function validatePasswordStrength(password: string): boolean;
242
- declare function AuthPasswordStrengthIndicator({ password }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
243
-
244
- interface AuthVerificationCodeInputProps {
245
- length?: number;
246
- value: string;
247
- email: string;
248
- onChange: (value: string) => void;
249
- disabled?: boolean;
250
- }
251
- declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
252
-
253
- declare const OAUTH_PROVIDER_CONFIG: Record<OAuthProvider, OAuthProviderConfig>;
254
- declare function getProviderConfig(provider: OAuthProvider): OAuthProviderConfig | null;
255
- declare function getProviderName(provider: OAuthProvider): string;
256
- declare function isProviderSupported(provider: string): provider is OAuthProvider;
257
-
258
- export { AuthBranding, AuthContainer, AuthDivider, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput, type ConditionalProps, InsforgeProvider, type InsforgeSession, type InsforgeUser, OAUTH_PROVIDER_CONFIG, type OAuthProvider, type OAuthProviderConfig, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, getProviderConfig, getProviderName, isProviderSupported, useAuth, useInsforge, useOAuthProviders, useSession, useUser, validatePasswordStrength };
@@ -1,20 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- interface InsforgeMiddlewareConfig {
4
- baseUrl: string;
5
- frontendUrl?: string;
6
- publicRoutes?: string[];
7
- afterSignInUrl?: string;
8
- signInUrl?: string;
9
- signUpUrl?: string;
10
- cookieName?: string;
11
- useBuiltInAuth?: boolean;
12
- }
13
- declare function InsforgeMiddleware(config: InsforgeMiddlewareConfig): (request: NextRequest) => Promise<NextResponse<unknown>>;
14
- declare const withAuth: typeof InsforgeMiddleware;
15
- declare const withInsforgeAuth: typeof InsforgeMiddleware;
16
- declare function getAuthUserId(headers: Headers): string | null;
17
- declare const getAuthUser: typeof getAuthUserId;
18
- declare function getAuthToken(headers: Headers): string | null;
19
-
20
- export { InsforgeMiddleware, type InsforgeMiddlewareConfig, getAuthToken, getAuthUser, getAuthUserId, withAuth, withInsforgeAuth };
@@ -1,20 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- interface InsforgeMiddlewareConfig {
4
- baseUrl: string;
5
- frontendUrl?: string;
6
- publicRoutes?: string[];
7
- afterSignInUrl?: string;
8
- signInUrl?: string;
9
- signUpUrl?: string;
10
- cookieName?: string;
11
- useBuiltInAuth?: boolean;
12
- }
13
- declare function InsforgeMiddleware(config: InsforgeMiddlewareConfig): (request: NextRequest) => Promise<NextResponse<unknown>>;
14
- declare const withAuth: typeof InsforgeMiddleware;
15
- declare const withInsforgeAuth: typeof InsforgeMiddleware;
16
- declare function getAuthUserId(headers: Headers): string | null;
17
- declare const getAuthUser: typeof getAuthUserId;
18
- declare function getAuthToken(headers: Headers): string | null;
19
-
20
- export { InsforgeMiddleware, type InsforgeMiddlewareConfig, getAuthToken, getAuthUser, getAuthUserId, withAuth, withInsforgeAuth };