forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverification.ts
More file actions
43 lines (35 loc) · 1.31 KB
/
Copy pathverification.ts
File metadata and controls
43 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { ClerkAPIError } from './api';
import type { PublicKeyCredentialCreationOptionsWithoutExtensions } from './passkey';
import type { ClerkResource } from './resource';
export interface VerificationResource extends ClerkResource {
attempts: number | null;
error: ClerkAPIError | null;
expireAt: Date | null;
externalVerificationRedirectURL: URL | null;
nonce: string | null;
message: string | null;
status: VerificationStatus | null;
strategy: string | null;
verifiedAtClient: string | null;
verifiedFromTheSameClient: () => boolean;
}
export interface PasskeyVerificationResource extends VerificationResource {
publicKey: PublicKeyCredentialCreationOptionsWithoutExtensions | null;
}
export type VerificationStatus = 'unverified' | 'verified' | 'transferable' | 'failed' | 'expired';
export interface CodeVerificationAttemptParam {
code: string;
signature?: never;
}
export interface SignatureVerificationAttemptParam {
code?: never;
signature: string;
}
export type VerificationAttemptParams = CodeVerificationAttemptParam | SignatureVerificationAttemptParam;
export interface StartEmailLinkFlowParams {
redirectUrl: string;
}
export type CreateEmailLinkFlowReturn<Params, Resource> = {
startEmailLinkFlow: (params: Params) => Promise<Resource>;
cancelEmailLinkFlow: () => void;
};