Skip to content

Commit

Permalink
refactor(core): rename the password input value key
Browse files Browse the repository at this point in the history
rename the password input value key
  • Loading branch information
simeng-li committed Jun 7, 2024
1 parent 6a0bee6 commit 2e2b586
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/routes/experience/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export default function experienceApiRoutes<T extends AnonymousRouter>(
ctx.interactionSession.setInteractionEvent(InteractionEvent.SignIn);

// TODO: Add support for other verification types

Check warning on line 54 in packages/core/src/routes/experience/index.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/core/src/routes/experience/index.ts#L54

[no-warning-comments] Unexpected 'todo' comment: 'TODO: Add support for other verification...'.
const { password } = verification;
const { value } = verification;
const passwordVerification = PasswordVerification.create(libraries, queries, identifier);
await passwordVerification.verify(password);
await passwordVerification.verify(value);
ctx.interactionSession.appendVerificationRecord(passwordVerification);

ctx.interactionSession.identifyUser(passwordVerification.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const signInWithPassword = async ({
identifier,
verification: {
type: VerificationType.Password,
password,
value: password,
},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/schemas/src/types/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const passwordSignInPayloadGuard = z.object({
identifier: passwordIdentifierGuard,
verification: z.object({
type: z.literal(VerificationType.Password),
password: z.string(),
value: z.string(),
}),
});
export type PasswordSignInPayload = z.infer<typeof passwordSignInPayloadGuard>;
Expand Down

0 comments on commit 2e2b586

Please sign in to comment.