Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 469
feat(clerk-js,clerk-react,types): Signal email link sign in support#6766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
f0a0a231267df728d915a1eee68eaa9a320b0dce13aac936a72a9f26e80fb61a0c4aaee3d1963a4212a4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@clerk/clerk-js': minor | ||
| '@clerk/clerk-react': minor | ||
| '@clerk/types': minor | ||
| --- | ||
| [Experimental] Signal email link support |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,6 +2,7 @@ import type { SetActiveNavigate } from './clerk'; | ||
| import type { PhoneCodeChannel } from './phoneCodeChannel'; | ||
| import type { SignInFirstFactor, SignInStatus } from './signInCommon'; | ||
| import type { OAuthStrategy } from './strategies'; | ||
| import type { VerificationResource } from './verification'; | ||
| export interface SignInFutureCreateParams { | ||
| identifier?: string; | ||
| @@ -41,6 +42,11 @@ export interface SignInFutureEmailCodeSendParams { | ||
| email: string; | ||
| } | ||
| export interface SignInFutureEmailLinkSendParams { | ||
| email: string; | ||
| verificationUrl: string; | ||
| } | ||
| export interface SignInFutureEmailCodeVerifyParams { | ||
| code: string; | ||
| } | ||
| @@ -111,6 +117,8 @@ export interface SignInFutureResource { | ||
| readonly existingSession?: { sessionId: string }; | ||
| readonly firstFactorVerification: VerificationResource; | ||
| /** | ||
| * Used to supply an identifier for the sign-in attempt. Calling this method will populate data on the sign-in | ||
| * attempt, such as `signIn.resource.supportedFirstFactors`. | ||
| @@ -137,6 +145,41 @@ export interface SignInFutureResource { | ||
| verifyCode: (params: SignInFutureEmailCodeVerifyParams) => Promise<{ error: unknown }>; | ||
| }; | ||
| /** | ||
| * | ||
| */ | ||
| emailLink: { | ||
| /** | ||
| * Used to send an email link to sign-in | ||
| */ | ||
| sendLink: (params: SignInFutureEmailLinkSendParams) => Promise<{ error: unknown }>; | ||
| /** | ||
| * Will wait for verification to complete or expire | ||
| */ | ||
| waitForVerification: () => Promise<{ error: unknown }>; | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The DX guide original stated | ||
| /** | ||
| * The verification status | ||
| */ | ||
| verification: { | ||
| /** | ||
| * The verification status | ||
| */ | ||
| status: 'verified' | 'expired' | 'failed' | 'client_mismatch'; | ||
| /** | ||
| * The created session ID | ||
| */ | ||
| createdSessionId: string; | ||
| /** | ||
| * Whether the verification was from the same client | ||
| */ | ||
| verifiedFromTheSameClient: boolean; | ||
| } | null; | ||
| }; | ||
| /** | ||
| * | ||
| */ | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need
wrapStructbecause of the getter (verification) that was introduced?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah,
emailLinkhas both methods and properties. We might be able to just usewrapStructin place ofwrapMethodsto be consistent though. Not sure if it's worth refactoring since this entire construct might be going away (hopefully [please])