-
Notifications
You must be signed in to change notification settings - Fork 84
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
feat: Add passkeys support #942
Conversation
// todo update this ??? | ||
export type TypeEmailPasswordPasswordResetEmailDeliveryInput = { | ||
type: "PASSWORD_RESET"; | ||
user: { | ||
id: string; | ||
recipeUserId: RecipeUserId | undefined; | ||
email: string; | ||
}; | ||
passwordResetLink: string; | ||
tenantId: string; | ||
}; | ||
|
||
export type TypeEmailPasswordEmailDeliveryInput = TypeEmailPasswordPasswordResetEmailDeliveryInput; |
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.
needs updating
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.
done
// default implementation for the TypeInput | ||
// todo update this ??? |
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.
// default implementation for the TypeInput | |
// todo update this ??? |
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.
done
export type RecipeInterface = { | ||
registerPasskeyOptions(input: { | ||
email: string; | ||
password: string; |
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.
password: string; |
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.
done
registerPasskeyOptions(input: { | ||
email: string; | ||
password: string; | ||
session: SessionContainerInterface | undefined; |
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.
session: SessionContainerInterface | undefined; |
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.
done
tenantId: string; | ||
userContext: UserContext; | ||
}): Promise<{ | ||
status: "OK"; |
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.
Are there any failure cases in this API?
status: "OK"; | ||
passkeyGeneratedOptionsId: string; | ||
rp: { | ||
id: string; |
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.
where are we getting the id from?
name: string; | ||
displayName: string; |
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.
where are these two coming from?
user: User; | ||
recipeUserId: RecipeUserId; | ||
} | ||
| { status: "EMAIL_ALREADY_EXISTS_ERROR" } |
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.
not sure if this is the best way, cause if this error comes, but the user has already added a passkey in their browser, so it would get confusing
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.
So instead, we should have this type of error in the part where we are generating a passkeyoption for the purpose of sign up?
userContext: UserContext; | ||
}): Promise< | ||
| { status: "OK"; user: User; recipeUserId: RecipeUserId } | ||
| { status: "WRONG_CREDENTIALS_ERROR" } |
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.
Should we call this WRONG_CREDENTIALS_ERROR or something else?
userContext: UserContext; | ||
}): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>; | ||
|
||
consumeRecoverAccountToken(input: { |
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.
how will this work? LIke the user has to first generate a passkey options right and then call this function after?
Summary of change
Add passkeys support
Related issues
Test Plan
More details here: https://docs.google.com/document/d/1G7tO9_dSNi8wur3ajGg4pq-wiHatKDbHv2sBt-uSbQg/edit