@authagonal/login 0.3.7 → 0.3.9
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/api.d.ts +4 -4
- package/dist/components/Turnstile.d.ts +13 -0
- package/dist/index.js +865 -765
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/api.ts +8 -8
- package/src/components/Turnstile.tsx +76 -0
- package/src/pages/ForgotPasswordPage.tsx +26 -4
- package/src/pages/LoginPage.tsx +24 -3
- package/src/pages/RegisterPage.tsx +29 -4
- package/src/pages/ResetPasswordPage.tsx +28 -3
- package/src/types.ts +2 -0
package/dist/api.d.ts
CHANGED
|
@@ -5,15 +5,15 @@ declare class ApiRequestError extends Error {
|
|
|
5
5
|
redirectUrl?: string;
|
|
6
6
|
constructor(apiError: ApiError);
|
|
7
7
|
}
|
|
8
|
-
export declare function login(email: string, password: string, returnUrl?: string): Promise<MfaLoginResponse>;
|
|
9
|
-
export declare function register(email: string, password: string, firstName?: string, lastName?: string): Promise<RegisterResponse>;
|
|
8
|
+
export declare function login(email: string, password: string, returnUrl?: string, turnstileToken?: string): Promise<MfaLoginResponse>;
|
|
9
|
+
export declare function register(email: string, password: string, firstName?: string, lastName?: string, turnstileToken?: string): Promise<RegisterResponse>;
|
|
10
10
|
export declare function logout(): Promise<{
|
|
11
11
|
success: true;
|
|
12
12
|
}>;
|
|
13
|
-
export declare function forgotPassword(email: string): Promise<{
|
|
13
|
+
export declare function forgotPassword(email: string, turnstileToken?: string): Promise<{
|
|
14
14
|
success: true;
|
|
15
15
|
}>;
|
|
16
|
-
export declare function resetPassword(token: string, newPassword: string): Promise<{
|
|
16
|
+
export declare function resetPassword(token: string, newPassword: string, turnstileToken?: string): Promise<{
|
|
17
17
|
success: true;
|
|
18
18
|
}>;
|
|
19
19
|
export declare function getSession(): Promise<SessionResponse>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
turnstile?: any;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
interface TurnstileProps {
|
|
7
|
+
siteKey: string;
|
|
8
|
+
/** Called with the token on success, or null when it expires / errors / is reset. */
|
|
9
|
+
onToken: (token: string | null) => void;
|
|
10
|
+
theme?: 'auto' | 'light' | 'dark';
|
|
11
|
+
}
|
|
12
|
+
export declare function Turnstile({ siteKey, onToken, theme }: TurnstileProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|