@adminforth/two-factors-auth 1.10.2 → 1.10.4
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,
|
|
16
|
-
total size is 57,
|
|
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(
|
|
183
|
-
codeError.value = '
|
|
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
|
}
|
|
@@ -179,11 +179,11 @@
|
|
|
179
179
|
await user.finishLogin();
|
|
180
180
|
} else {
|
|
181
181
|
if (usePasskey) {
|
|
182
|
-
showErrorTost(t(
|
|
183
|
-
codeError.value = '
|
|
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
|
}
|
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
|
|
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) {
|
|
@@ -334,7 +334,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
|
|
|
334
334
|
return { status: 'ok', allowedLogin: true };
|
|
335
335
|
}
|
|
336
336
|
else {
|
|
337
|
-
return { error: '
|
|
337
|
+
return { error: 'Verification failed' };
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
})
|
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
|
|
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) {
|
|
@@ -358,7 +358,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
|
|
|
358
358
|
this.adminforth.auth.setAuthCookie({expireInDays: decoded.rememberMeDays, response, username:decoded.userName, pk:decoded.pk})
|
|
359
359
|
return { status: 'ok', allowedLogin: true }
|
|
360
360
|
} else {
|
|
361
|
-
return {error: '
|
|
361
|
+
return {error: 'Verification failed'}
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
}
|