@adminforth/two-factors-auth 3.1.5 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -732,7 +732,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
732
732
  }
733
733
  });
734
734
  if (!verificationResult || !('ok' in verificationResult)) {
735
- return { ok: false, error: 'Verification failed' };
735
+ return { ok: false, error: 'error' in verificationResult ? verificationResult.error : 'Verification failed' };
736
736
  }
737
737
  const settingsOrigin = (_b = this.options.passkeys) === null || _b === void 0 ? void 0 : _b.settings.expectedOrigin;
738
738
  const rp = {
package/index.ts CHANGED
@@ -791,8 +791,8 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
791
791
  headers,
792
792
  } as HttpExtra
793
793
  });
794
- if ( !verificationResult || !('ok' in verificationResult) ) {
795
- return { ok: false, error: 'Verification failed' };
794
+ if (!verificationResult || !('ok' in verificationResult)) {
795
+ return { ok: false, error: 'error' in verificationResult ? verificationResult.error : 'Verification failed' };
796
796
  }
797
797
 
798
798
  const settingsOrigin = this.options.passkeys?.settings.expectedOrigin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "3.1.5",
3
+ "version": "3.2.0",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",