@adminforth/two-factors-auth 2.7.1 → 2.7.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
@@ -15,5 +15,5 @@ custom/package.json
15
15
  custom/tsconfig.json
16
16
  custom/utils.js
17
17
 
18
- sent 272,788 bytes received 210 bytes 545,996.00 bytes/sec
19
- total size is 271,961 speedup is 1.00
18
+ sent 271,998 bytes received 210 bytes 544,416.00 bytes/sec
19
+ total size is 271,171 speedup is 1.00
@@ -158,24 +158,8 @@
158
158
  try {
159
159
  passkeyData = await getPasskey();
160
160
  } catch (error) {
161
- const name = (error && (error.name || error.constructor?.name)) || '';
162
- const message = (error && error.message) || '';
163
- if (name === 'AbortError') {
164
- // Aborted intentionally; no user-facing error needed
165
- return null;
166
- } else if (name === 'InvalidStateError' || name === 'OperationError' || /pending/i.test(message)) {
167
- adminforth.alert({ message: t('Another security prompt is already open. Please try again.'), variant: 'warning' });
168
- onCancel();
169
- return null;
170
- } else if (name === 'NotAllowedError') {
171
- adminforth.alert({ message: t('The operation either timed out or was not allowed'), variant: 'warning' });
172
- onCancel();
173
- return null;
174
- } else {
175
- adminforth.alert({message: t(`Error during authentication: ${error}`), variant: 'warning'});
176
- onCancel();
177
- return null;
178
- }
161
+ onCancel();
162
+ return null;
179
163
  }
180
164
  modelShow.value = false;
181
165
  const dataToReturn = {
@@ -288,6 +288,8 @@ const handleSkip = async () => {
288
288
  handlePasskeyAlert();
289
289
  }
290
290
  await user.finishLogin();
291
+ } else if (resp.error) {
292
+ codeError.value = resp.error;
291
293
  } else {
292
294
  codeError.value = 'Something went wrong';
293
295
  }
@@ -158,24 +158,8 @@
158
158
  try {
159
159
  passkeyData = await getPasskey();
160
160
  } catch (error) {
161
- const name = (error && (error.name || error.constructor?.name)) || '';
162
- const message = (error && error.message) || '';
163
- if (name === 'AbortError') {
164
- // Aborted intentionally; no user-facing error needed
165
- return null;
166
- } else if (name === 'InvalidStateError' || name === 'OperationError' || /pending/i.test(message)) {
167
- adminforth.alert({ message: t('Another security prompt is already open. Please try again.'), variant: 'warning' });
168
- onCancel();
169
- return null;
170
- } else if (name === 'NotAllowedError') {
171
- adminforth.alert({ message: t('The operation either timed out or was not allowed'), variant: 'warning' });
172
- onCancel();
173
- return null;
174
- } else {
175
- adminforth.alert({message: t(`Error during authentication: ${error}`), variant: 'warning'});
176
- onCancel();
177
- return null;
178
- }
161
+ onCancel();
162
+ return null;
179
163
  }
180
164
  modelShow.value = false;
181
165
  const dataToReturn = {
@@ -288,6 +288,8 @@ const handleSkip = async () => {
288
288
  handlePasskeyAlert();
289
289
  }
290
290
  await user.finishLogin();
291
+ } else if (resp.error) {
292
+ codeError.value = resp.error;
291
293
  } else {
292
294
  codeError.value = 'Something went wrong';
293
295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",