Skip to content

Commit e591acf

Browse files
Add support for parsing email to be read from query in recovery flow
1 parent 0404d22 commit e591acf

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

lib/ts/recipe/webauthn/components/features/recoverAccountWithToken/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type { RecoverAccountWithTokenProps } from "../../../types";
2626

2727
export const RecoverAccountUsingToken: React.FC<RecoverAccountWithTokenProps> = (props): JSX.Element => {
2828
const token = getQueryParams("token");
29+
const email = getQueryParams("email");
2930
let userContext;
3031
if (props.userContext !== undefined) {
3132
userContext = props.userContext;
@@ -41,6 +42,7 @@ export const RecoverAccountUsingToken: React.FC<RecoverAccountWithTokenProps> =
4142
token,
4243
useComponentOverride: props.useComponentOverrides,
4344
userContext,
45+
email,
4446
};
4547
const recipeComponentOverrides = props.useComponentOverrides();
4648

lib/ts/recipe/webauthn/components/themes/recoverAccountWithToken/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const RecoverAccountThemeInner = (
9090
return props.activeScreen === RecoverAccountScreen.ContinueWithPasskey ? (
9191
<PasskeyConfirmation
9292
{...props}
93-
email={""}
93+
email={props.email || ""}
9494
onContinueClick={() => {}}
9595
// errorMessageLabel={showPasskeyConfirmationError ? "WEBAUTHN_PASSKEY_RECOVERABLE_ERROR" : undefined}
9696
isLoading={false}

lib/ts/recipe/webauthn/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export type RecoverAccountWithTokenThemeProps = {
184184
error: string | undefined;
185185
clearError: () => void;
186186
onError: (error: string) => void;
187+
email: string | null;
187188
};
188189

189190
export type ContinueOnSuccessParams = {

stories/allrecipes.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const RecoverAccountWithToken: Story = {
139139
"multifactorauth.initialized": false,
140140
"passwordless.initialized": false,
141141
"webauthn.initialized": true,
142-
query: "token=asdf",
142+
query: "token=asdf&[email protected]",
143143
},
144144
};
145145

0 commit comments

Comments
 (0)