@niledatabase/react 4.0.0-alpha.16 → 4.0.0-alpha.17
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.d.mts +102 -114
- package/dist/index.d.ts +102 -114
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
5
|
import * as next_auth_react from 'next-auth/react';
|
|
6
|
-
import { SignInOptions, LiteralUnion, ClientSafeProvider, SignOutParams, SignOutResponse, SignInAuthorizationParams, SignInResponse, UseSessionOptions } from 'next-auth/react';
|
|
6
|
+
import { SignInOptions, LiteralUnion, ClientSafeProvider, SignOutParams, SignOutResponse, SignInAuthorizationParams, SignInResponse as SignInResponse$1, UseSessionOptions } from 'next-auth/react';
|
|
7
7
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
8
8
|
import { VariantProps } from 'class-variance-authority';
|
|
9
9
|
import { CtxOrReq } from 'next-auth/client/_utils';
|
|
@@ -29,119 +29,11 @@ declare const buttonVariants: (props?: ({
|
|
|
29
29
|
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
30
30
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
31
31
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
32
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
32
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
33
33
|
asChild?: boolean;
|
|
34
34
|
loading?: boolean;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
type EmailError = void | {
|
|
38
|
-
error: string;
|
|
39
|
-
ok: boolean;
|
|
40
|
-
status: number;
|
|
41
|
-
url: null | string;
|
|
42
|
-
};
|
|
43
|
-
type AllProps = ButtonProps & {
|
|
44
|
-
callbackUrl?: string;
|
|
45
|
-
redirect?: boolean;
|
|
46
|
-
email: string;
|
|
47
|
-
onSent?: () => void;
|
|
48
|
-
onFailure?: (error: EmailError) => void;
|
|
49
|
-
buttonText?: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* This works when the email identity provider is configured in the admin dashboard.
|
|
53
|
-
* @param props callbackUrl: the url to send the user to from their email
|
|
54
|
-
* @param props redirect: redirect to the default (unbranded) 'check your email' page. default is false
|
|
55
|
-
* @param props email: the email to send to
|
|
56
|
-
* @param props onSent: called if the email was sent
|
|
57
|
-
* @param props onFailure: called if there was a reportable
|
|
58
|
-
* @returns a JSX.Element to render
|
|
59
|
-
*/
|
|
60
|
-
declare const EmailSignInButton: {
|
|
61
|
-
({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, ...props }: AllProps): React__default.JSX.Element;
|
|
62
|
-
displayName: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* A component for a Google login button, according to their design language.
|
|
69
|
-
* This works when an identity provider is configured in the admin dashboard.
|
|
70
|
-
* @param props callbackUrl: a string to override the URL provided by the context
|
|
71
|
-
* @returns a JSX.Element to render
|
|
72
|
-
*/
|
|
73
|
-
declare const GoogleSSOButton: {
|
|
74
|
-
({ callbackUrl, className, variant, size, buttonText, asChild, init, ...props }: ButtonProps & {
|
|
75
|
-
callbackUrl?: string;
|
|
76
|
-
buttonText?: string;
|
|
77
|
-
init?: RequestInit;
|
|
78
|
-
}): React__default.JSX.Element;
|
|
79
|
-
displayName: string;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
declare const AzureSignInButton: {
|
|
83
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
84
|
-
callbackUrl?: string;
|
|
85
|
-
buttonText?: string;
|
|
86
|
-
init?: RequestInit;
|
|
87
|
-
}): React__default.JSX.Element;
|
|
88
|
-
displayName: string;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
declare const DiscordSignInButton: {
|
|
92
|
-
({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
|
|
93
|
-
callbackUrl?: string;
|
|
94
|
-
buttonText?: string;
|
|
95
|
-
init?: RequestInit;
|
|
96
|
-
}): React__default.JSX.Element;
|
|
97
|
-
displayName: string;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
declare const GitHubSignInButton: {
|
|
101
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
102
|
-
callbackUrl?: string;
|
|
103
|
-
buttonText?: string;
|
|
104
|
-
init?: RequestInit;
|
|
105
|
-
}): React__default.JSX.Element;
|
|
106
|
-
displayName: string;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
declare const HubSpotSignInButton: {
|
|
110
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
111
|
-
callbackUrl?: string;
|
|
112
|
-
buttonText?: string;
|
|
113
|
-
init?: RequestInit;
|
|
114
|
-
}): React__default.JSX.Element;
|
|
115
|
-
displayName: string;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
declare const LinkedInSignInButton: {
|
|
119
|
-
({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
|
|
120
|
-
callbackUrl?: string;
|
|
121
|
-
buttonText?: string;
|
|
122
|
-
init?: RequestInit;
|
|
123
|
-
}): React__default.JSX.Element;
|
|
124
|
-
displayName: string;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
declare const SlackSignInButton: {
|
|
128
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
129
|
-
callbackUrl?: string;
|
|
130
|
-
buttonText?: string;
|
|
131
|
-
init?: RequestInit;
|
|
132
|
-
}): React__default.JSX.Element;
|
|
133
|
-
displayName: string;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
declare const XSignInButton: {
|
|
137
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
138
|
-
callbackUrl?: string;
|
|
139
|
-
buttonText?: string;
|
|
140
|
-
init?: RequestInit;
|
|
141
|
-
}): React__default.JSX.Element;
|
|
142
|
-
displayName: string;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
37
|
type JWT = {
|
|
146
38
|
email: string;
|
|
147
39
|
sub: string;
|
|
@@ -276,7 +168,7 @@ declare class Authorizer {
|
|
|
276
168
|
init?: ResponseInit;
|
|
277
169
|
fetchUrl?: string;
|
|
278
170
|
auth?: Authorizer | PartialAuthorizer;
|
|
279
|
-
}, authorizationParams?: SignInAuthorizationParams): Promise<P extends RedirectableProviderType ? SignInResponse | undefined : undefined>;
|
|
171
|
+
}, authorizationParams?: SignInAuthorizationParams): Promise<P extends RedirectableProviderType ? SignInResponse$1 | undefined : undefined>;
|
|
280
172
|
signUp(options: {
|
|
281
173
|
baseUrl?: string;
|
|
282
174
|
init?: ResponseInit;
|
|
@@ -299,6 +191,102 @@ declare const getProviders: () => Promise<Record<LiteralUnion<BuiltInProviderTyp
|
|
|
299
191
|
declare const signOut: typeof authorizer.signOut;
|
|
300
192
|
declare const signIn: typeof authorizer.signIn;
|
|
301
193
|
|
|
194
|
+
interface SignInResponse {
|
|
195
|
+
error: string | null;
|
|
196
|
+
status: number;
|
|
197
|
+
ok: boolean;
|
|
198
|
+
url: string | null;
|
|
199
|
+
}
|
|
200
|
+
type SSOButtonProps = {
|
|
201
|
+
callbackUrl?: string;
|
|
202
|
+
buttonText?: string;
|
|
203
|
+
init?: RequestInit;
|
|
204
|
+
baseUrl?: string;
|
|
205
|
+
fetchUrl?: string;
|
|
206
|
+
auth?: Authorizer | PartialAuthorizer;
|
|
207
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, res: SignInResponse | undefined) => void;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type EmailError = void | {
|
|
211
|
+
error: string;
|
|
212
|
+
ok: boolean;
|
|
213
|
+
status: number;
|
|
214
|
+
url: null | string;
|
|
215
|
+
};
|
|
216
|
+
type AllProps = ButtonProps & SSOButtonProps & {
|
|
217
|
+
callbackUrl?: string;
|
|
218
|
+
redirect?: boolean;
|
|
219
|
+
email: string;
|
|
220
|
+
onSent?: () => void;
|
|
221
|
+
onFailure?: (error: EmailError) => void;
|
|
222
|
+
buttonText?: string;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* This works when the email identity provider is configured in the admin dashboard.
|
|
226
|
+
* @param props callbackUrl: the url to send the user to from their email
|
|
227
|
+
* @param props redirect: redirect to the default (unbranded) 'check your email' page. default is false
|
|
228
|
+
* @param props email: the email to send to
|
|
229
|
+
* @param props onSent: called if the email was sent
|
|
230
|
+
* @param props onFailure: called if there was a reportable
|
|
231
|
+
* @returns a JSX.Element to render
|
|
232
|
+
*/
|
|
233
|
+
declare const EmailSignInButton: {
|
|
234
|
+
({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, fetchUrl, baseUrl, auth, ...props }: AllProps): React__default.JSX.Element;
|
|
235
|
+
displayName: string;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* A component for a Google login button, according to their design language.
|
|
242
|
+
* This works when an identity provider is configured in the admin dashboard.
|
|
243
|
+
* @param props callbackUrl: a string to override the URL provided by the context
|
|
244
|
+
* @returns a JSX.Element to render
|
|
245
|
+
*/
|
|
246
|
+
declare const GoogleSSOButton: {
|
|
247
|
+
({ callbackUrl, className, variant, size, buttonText, asChild, init, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
248
|
+
displayName: string;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
declare const AzureSignInButton: {
|
|
252
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
253
|
+
displayName: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
declare const DiscordSignInButton: {
|
|
257
|
+
({ callbackUrl, className, buttonText, variant, size, asChild, init, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
258
|
+
displayName: string;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
declare const GitHubSignInButton: {
|
|
262
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
263
|
+
displayName: string;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
declare const HubSpotSignInButton: {
|
|
267
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
268
|
+
displayName: string;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
declare const LinkedInSignInButton: {
|
|
272
|
+
({ callbackUrl, className, buttonText, variant, size, asChild, init, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
273
|
+
displayName: string;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
declare const SlackSignInButton: {
|
|
277
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
278
|
+
callbackUrl?: string;
|
|
279
|
+
buttonText?: string;
|
|
280
|
+
init?: RequestInit;
|
|
281
|
+
}): React__default.JSX.Element;
|
|
282
|
+
displayName: string;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
declare const XSignInButton: {
|
|
286
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
287
|
+
displayName: string;
|
|
288
|
+
};
|
|
289
|
+
|
|
302
290
|
type ComponentFetchProps = {
|
|
303
291
|
auth?: Authorizer | PartialAuthorizer;
|
|
304
292
|
init?: RequestInit;
|
|
@@ -532,7 +520,7 @@ declare function ResetPasswordForm(params: Params): React__default.JSX.Element;
|
|
|
532
520
|
|
|
533
521
|
declare function useResetPassword(params?: Params): _tanstack_react_query.UseMutateFunction<Response, Error, MutateFnParams, unknown>;
|
|
534
522
|
|
|
535
|
-
declare const Email: () => React.JSX.Element;
|
|
536
|
-
declare const Password: () => React.JSX.Element;
|
|
523
|
+
declare const Email: () => React$1.JSX.Element;
|
|
524
|
+
declare const Password: () => React$1.JSX.Element;
|
|
537
525
|
|
|
538
526
|
export { type ActiveSession, type AuthConfig, type AuthState, Authorizer, AzureSignInButton as Azure, DiscordSignInButton as Discord, Email, EmailSigningIn as EmailSignIn, EmailSignInButton, GitHubSignInButton as GitHub, GoogleSSOButton as Google, HubSpotSignInButton as HubSpot, type JWT, LinkedInSignInButton as LinkedIn, type Listener, type ListenerKeys, type ListenerParams, Password, ResetPasswordForm as PasswordResetForm, ResetPasswordForm$1 as PasswordResetRequestForm, type NonErrorSession as Session, SessionContext, SessionProvider, SigningIn as SignInForm, SignOutButton, SigningUp as SignUpForm, SignedIn, SignedOut, SlackSignInButton as Slack, TenantSelector, UserInfo, XSignInButton as X, auth, getCsrfToken, getProviders, getSession, signIn, signOut, useEmailSignIn, useMe, useResetPassword, useSession, useSignIn, useSignUp, useTenantId, useTenants };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
5
|
import * as next_auth_react from 'next-auth/react';
|
|
6
|
-
import { SignInOptions, LiteralUnion, ClientSafeProvider, SignOutParams, SignOutResponse, SignInAuthorizationParams, SignInResponse, UseSessionOptions } from 'next-auth/react';
|
|
6
|
+
import { SignInOptions, LiteralUnion, ClientSafeProvider, SignOutParams, SignOutResponse, SignInAuthorizationParams, SignInResponse as SignInResponse$1, UseSessionOptions } from 'next-auth/react';
|
|
7
7
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
8
8
|
import { VariantProps } from 'class-variance-authority';
|
|
9
9
|
import { CtxOrReq } from 'next-auth/client/_utils';
|
|
@@ -29,119 +29,11 @@ declare const buttonVariants: (props?: ({
|
|
|
29
29
|
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
30
30
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
31
31
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
32
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
32
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
33
33
|
asChild?: boolean;
|
|
34
34
|
loading?: boolean;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
type EmailError = void | {
|
|
38
|
-
error: string;
|
|
39
|
-
ok: boolean;
|
|
40
|
-
status: number;
|
|
41
|
-
url: null | string;
|
|
42
|
-
};
|
|
43
|
-
type AllProps = ButtonProps & {
|
|
44
|
-
callbackUrl?: string;
|
|
45
|
-
redirect?: boolean;
|
|
46
|
-
email: string;
|
|
47
|
-
onSent?: () => void;
|
|
48
|
-
onFailure?: (error: EmailError) => void;
|
|
49
|
-
buttonText?: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* This works when the email identity provider is configured in the admin dashboard.
|
|
53
|
-
* @param props callbackUrl: the url to send the user to from their email
|
|
54
|
-
* @param props redirect: redirect to the default (unbranded) 'check your email' page. default is false
|
|
55
|
-
* @param props email: the email to send to
|
|
56
|
-
* @param props onSent: called if the email was sent
|
|
57
|
-
* @param props onFailure: called if there was a reportable
|
|
58
|
-
* @returns a JSX.Element to render
|
|
59
|
-
*/
|
|
60
|
-
declare const EmailSignInButton: {
|
|
61
|
-
({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, ...props }: AllProps): React__default.JSX.Element;
|
|
62
|
-
displayName: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* A component for a Google login button, according to their design language.
|
|
69
|
-
* This works when an identity provider is configured in the admin dashboard.
|
|
70
|
-
* @param props callbackUrl: a string to override the URL provided by the context
|
|
71
|
-
* @returns a JSX.Element to render
|
|
72
|
-
*/
|
|
73
|
-
declare const GoogleSSOButton: {
|
|
74
|
-
({ callbackUrl, className, variant, size, buttonText, asChild, init, ...props }: ButtonProps & {
|
|
75
|
-
callbackUrl?: string;
|
|
76
|
-
buttonText?: string;
|
|
77
|
-
init?: RequestInit;
|
|
78
|
-
}): React__default.JSX.Element;
|
|
79
|
-
displayName: string;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
declare const AzureSignInButton: {
|
|
83
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
84
|
-
callbackUrl?: string;
|
|
85
|
-
buttonText?: string;
|
|
86
|
-
init?: RequestInit;
|
|
87
|
-
}): React__default.JSX.Element;
|
|
88
|
-
displayName: string;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
declare const DiscordSignInButton: {
|
|
92
|
-
({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
|
|
93
|
-
callbackUrl?: string;
|
|
94
|
-
buttonText?: string;
|
|
95
|
-
init?: RequestInit;
|
|
96
|
-
}): React__default.JSX.Element;
|
|
97
|
-
displayName: string;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
declare const GitHubSignInButton: {
|
|
101
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
102
|
-
callbackUrl?: string;
|
|
103
|
-
buttonText?: string;
|
|
104
|
-
init?: RequestInit;
|
|
105
|
-
}): React__default.JSX.Element;
|
|
106
|
-
displayName: string;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
declare const HubSpotSignInButton: {
|
|
110
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
111
|
-
callbackUrl?: string;
|
|
112
|
-
buttonText?: string;
|
|
113
|
-
init?: RequestInit;
|
|
114
|
-
}): React__default.JSX.Element;
|
|
115
|
-
displayName: string;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
declare const LinkedInSignInButton: {
|
|
119
|
-
({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
|
|
120
|
-
callbackUrl?: string;
|
|
121
|
-
buttonText?: string;
|
|
122
|
-
init?: RequestInit;
|
|
123
|
-
}): React__default.JSX.Element;
|
|
124
|
-
displayName: string;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
declare const SlackSignInButton: {
|
|
128
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
129
|
-
callbackUrl?: string;
|
|
130
|
-
buttonText?: string;
|
|
131
|
-
init?: RequestInit;
|
|
132
|
-
}): React__default.JSX.Element;
|
|
133
|
-
displayName: string;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
declare const XSignInButton: {
|
|
137
|
-
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
138
|
-
callbackUrl?: string;
|
|
139
|
-
buttonText?: string;
|
|
140
|
-
init?: RequestInit;
|
|
141
|
-
}): React__default.JSX.Element;
|
|
142
|
-
displayName: string;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
37
|
type JWT = {
|
|
146
38
|
email: string;
|
|
147
39
|
sub: string;
|
|
@@ -276,7 +168,7 @@ declare class Authorizer {
|
|
|
276
168
|
init?: ResponseInit;
|
|
277
169
|
fetchUrl?: string;
|
|
278
170
|
auth?: Authorizer | PartialAuthorizer;
|
|
279
|
-
}, authorizationParams?: SignInAuthorizationParams): Promise<P extends RedirectableProviderType ? SignInResponse | undefined : undefined>;
|
|
171
|
+
}, authorizationParams?: SignInAuthorizationParams): Promise<P extends RedirectableProviderType ? SignInResponse$1 | undefined : undefined>;
|
|
280
172
|
signUp(options: {
|
|
281
173
|
baseUrl?: string;
|
|
282
174
|
init?: ResponseInit;
|
|
@@ -299,6 +191,102 @@ declare const getProviders: () => Promise<Record<LiteralUnion<BuiltInProviderTyp
|
|
|
299
191
|
declare const signOut: typeof authorizer.signOut;
|
|
300
192
|
declare const signIn: typeof authorizer.signIn;
|
|
301
193
|
|
|
194
|
+
interface SignInResponse {
|
|
195
|
+
error: string | null;
|
|
196
|
+
status: number;
|
|
197
|
+
ok: boolean;
|
|
198
|
+
url: string | null;
|
|
199
|
+
}
|
|
200
|
+
type SSOButtonProps = {
|
|
201
|
+
callbackUrl?: string;
|
|
202
|
+
buttonText?: string;
|
|
203
|
+
init?: RequestInit;
|
|
204
|
+
baseUrl?: string;
|
|
205
|
+
fetchUrl?: string;
|
|
206
|
+
auth?: Authorizer | PartialAuthorizer;
|
|
207
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, res: SignInResponse | undefined) => void;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type EmailError = void | {
|
|
211
|
+
error: string;
|
|
212
|
+
ok: boolean;
|
|
213
|
+
status: number;
|
|
214
|
+
url: null | string;
|
|
215
|
+
};
|
|
216
|
+
type AllProps = ButtonProps & SSOButtonProps & {
|
|
217
|
+
callbackUrl?: string;
|
|
218
|
+
redirect?: boolean;
|
|
219
|
+
email: string;
|
|
220
|
+
onSent?: () => void;
|
|
221
|
+
onFailure?: (error: EmailError) => void;
|
|
222
|
+
buttonText?: string;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* This works when the email identity provider is configured in the admin dashboard.
|
|
226
|
+
* @param props callbackUrl: the url to send the user to from their email
|
|
227
|
+
* @param props redirect: redirect to the default (unbranded) 'check your email' page. default is false
|
|
228
|
+
* @param props email: the email to send to
|
|
229
|
+
* @param props onSent: called if the email was sent
|
|
230
|
+
* @param props onFailure: called if there was a reportable
|
|
231
|
+
* @returns a JSX.Element to render
|
|
232
|
+
*/
|
|
233
|
+
declare const EmailSignInButton: {
|
|
234
|
+
({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, fetchUrl, baseUrl, auth, ...props }: AllProps): React__default.JSX.Element;
|
|
235
|
+
displayName: string;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* A component for a Google login button, according to their design language.
|
|
242
|
+
* This works when an identity provider is configured in the admin dashboard.
|
|
243
|
+
* @param props callbackUrl: a string to override the URL provided by the context
|
|
244
|
+
* @returns a JSX.Element to render
|
|
245
|
+
*/
|
|
246
|
+
declare const GoogleSSOButton: {
|
|
247
|
+
({ callbackUrl, className, variant, size, buttonText, asChild, init, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
248
|
+
displayName: string;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
declare const AzureSignInButton: {
|
|
252
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
253
|
+
displayName: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
declare const DiscordSignInButton: {
|
|
257
|
+
({ callbackUrl, className, buttonText, variant, size, asChild, init, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
258
|
+
displayName: string;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
declare const GitHubSignInButton: {
|
|
262
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
263
|
+
displayName: string;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
declare const HubSpotSignInButton: {
|
|
267
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
268
|
+
displayName: string;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
declare const LinkedInSignInButton: {
|
|
272
|
+
({ callbackUrl, className, buttonText, variant, size, asChild, init, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
273
|
+
displayName: string;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
declare const SlackSignInButton: {
|
|
277
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
278
|
+
callbackUrl?: string;
|
|
279
|
+
buttonText?: string;
|
|
280
|
+
init?: RequestInit;
|
|
281
|
+
}): React__default.JSX.Element;
|
|
282
|
+
displayName: string;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
declare const XSignInButton: {
|
|
286
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, auth, fetchUrl, baseUrl, ...props }: ButtonProps & SSOButtonProps): React__default.JSX.Element;
|
|
287
|
+
displayName: string;
|
|
288
|
+
};
|
|
289
|
+
|
|
302
290
|
type ComponentFetchProps = {
|
|
303
291
|
auth?: Authorizer | PartialAuthorizer;
|
|
304
292
|
init?: RequestInit;
|
|
@@ -532,7 +520,7 @@ declare function ResetPasswordForm(params: Params): React__default.JSX.Element;
|
|
|
532
520
|
|
|
533
521
|
declare function useResetPassword(params?: Params): _tanstack_react_query.UseMutateFunction<Response, Error, MutateFnParams, unknown>;
|
|
534
522
|
|
|
535
|
-
declare const Email: () => React.JSX.Element;
|
|
536
|
-
declare const Password: () => React.JSX.Element;
|
|
523
|
+
declare const Email: () => React$1.JSX.Element;
|
|
524
|
+
declare const Password: () => React$1.JSX.Element;
|
|
537
525
|
|
|
538
526
|
export { type ActiveSession, type AuthConfig, type AuthState, Authorizer, AzureSignInButton as Azure, DiscordSignInButton as Discord, Email, EmailSigningIn as EmailSignIn, EmailSignInButton, GitHubSignInButton as GitHub, GoogleSSOButton as Google, HubSpotSignInButton as HubSpot, type JWT, LinkedInSignInButton as LinkedIn, type Listener, type ListenerKeys, type ListenerParams, Password, ResetPasswordForm as PasswordResetForm, ResetPasswordForm$1 as PasswordResetRequestForm, type NonErrorSession as Session, SessionContext, SessionProvider, SigningIn as SignInForm, SignOutButton, SigningUp as SignUpForm, SignedIn, SignedOut, SlackSignInButton as Slack, TenantSelector, UserInfo, XSignInButton as X, auth, getCsrfToken, getProviders, getSession, signIn, signOut, useEmailSignIn, useMe, useResetPassword, useSession, useSignIn, useSignUp, useTenantId, useTenants };
|