This commit is contained in:
Max Peintner
2023-06-19 15:59:16 +02:00
parent 3aa8e8fbc4
commit ed7d612660
6 changed files with 20 additions and 34 deletions

View File

@@ -52,7 +52,14 @@ export default function PasswordForm({ loginName }: Props) {
function submitPasswordAndContinue(value: Inputs): Promise<boolean | void> {
return submitPassword(value).then((resp: any) => {
return router.push(`/accounts`);
if (resp.factors && !resp.factors.passwordless) {
return router.push(
`/passkey/add?` +
new URLSearchParams({ loginName: resp.factors.user.loginName })
);
} else {
return router.push(`/accounts`);
}
});
}