@adminforth/two-factors-auth 1.10.2 → 1.10.3

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/build.log CHANGED
@@ -12,5 +12,5 @@ custom/package-lock.json
12
12
  custom/package.json
13
13
  custom/tsconfig.json
14
14
 
15
- sent 57,630 bytes received 153 bytes 115,566.00 bytes/sec
16
- total size is 57,057 speedup is 0.99
15
+ sent 57,692 bytes received 153 bytes 115,690.00 bytes/sec
16
+ total size is 57,119 speedup is 0.99
@@ -179,11 +179,11 @@
179
179
  await user.finishLogin();
180
180
  } else {
181
181
  if (usePasskey) {
182
- showErrorTost(t('Invalid passkey'));
183
- codeError.value = 'Invalid passkey';
182
+ showErrorTost(t(resp.error));
183
+ codeError.value = resp.error || t('Passkey authentication failed');
184
184
  } else {
185
185
  showErrorTost(t(resp.error));
186
- codeError.value = resp.error;
186
+ codeError.value = resp.error || t('Invalid code');
187
187
  }
188
188
  }
189
189
  }
@@ -241,7 +241,7 @@ async function sendCode (value) {
241
241
  }
242
242
  await user.finishLogin();
243
243
  } else {
244
- codeError.value = 'Invalid code';
244
+ codeError.value = resp.error || t('Invalid code');
245
245
  }
246
246
  }
247
247
 
@@ -179,11 +179,11 @@
179
179
  await user.finishLogin();
180
180
  } else {
181
181
  if (usePasskey) {
182
- showErrorTost(t('Invalid passkey'));
183
- codeError.value = 'Invalid passkey';
182
+ showErrorTost(t(resp.error));
183
+ codeError.value = resp.error || t('Passkey authentication failed');
184
184
  } else {
185
185
  showErrorTost(t(resp.error));
186
- codeError.value = resp.error;
186
+ codeError.value = resp.error || t('Invalid code');
187
187
  }
188
188
  }
189
189
  }
@@ -241,7 +241,7 @@ async function sendCode (value) {
241
241
  }
242
242
  await user.finishLogin();
243
243
  } else {
244
- codeError.value = 'Invalid code';
244
+ codeError.value = resp.error || t('Invalid code');
245
245
  }
246
246
  }
247
247
 
package/dist/index.js CHANGED
@@ -314,7 +314,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
314
314
  }
315
315
  const decodedPasskeysCookies = yield this.adminforth.auth.verify(passkeysCookies, 'tempPasskeyChallenge', false);
316
316
  if (!decodedPasskeysCookies) {
317
- return { error: 'Invalid passkey token' };
317
+ return { error: 'Invalid passkey' };
318
318
  }
319
319
  const res = yield this.verifyPasskeyResponse(body.passkeyOptions, decoded.pk, decodedPasskeysCookies);
320
320
  if (res.ok && res.passkeyConfirmed) {
package/index.ts CHANGED
@@ -340,7 +340,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
340
340
  }
341
341
  const decodedPasskeysCookies = await this.adminforth.auth.verify(passkeysCookies, 'tempPasskeyChallenge', false);
342
342
  if (!decodedPasskeysCookies) {
343
- return { error: 'Invalid passkey token' };
343
+ return { error: 'Invalid passkey' };
344
344
  }
345
345
  const res = await this.verifyPasskeyResponse(body.passkeyOptions, decoded.pk, decodedPasskeysCookies);
346
346
  if (res.ok && res.passkeyConfirmed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",