File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 279279 }
280280
281281 async function checkIfUserHasPasskeys() {
282+ if (! route .meta .isPasskeysEnabled ) {
283+ return ;
284+ }
282285 try {
283286 await callAdminForthApi ({
284287 method: ' POST' ,
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments