Skip to content

Commit 0dcea3d

Browse files
committed
fix: add checks if passkeys feature setted up in user verification and confirmation processes
1 parent 61cebe6 commit 0dcea3d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

custom/TwoFactorsConfirmation.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@
279279
}
280280
281281
async function checkIfUserHasPasskeys() {
282+
if(!route.meta.isPasskeysEnabled) {
283+
return;
284+
}
282285
try {
283286
await callAdminForthApi({
284287
method: 'POST',

index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,9 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
834834
path: `/plugin/passkeys/checkIfUserHasPasskeys`,
835835
noAuth: true,
836836
handler: async ({ cookies }) => {
837+
if (!this.options.passkeys) {
838+
return { ok: false, hasPasskeys: false };
839+
}
837840
const totpTemporaryJWT = this.adminforth.auth.getCustomCookie({cookies: cookies, name: "2FaTemporaryJWT"});
838841
const decoded = await this.adminforth.auth.verify(totpTemporaryJWT, 'temp2FA');
839842
if (!decoded)

0 commit comments

Comments
 (0)