@adminforth/two-factors-auth 3.1.1 → 3.1.2

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
@@ -16,5 +16,5 @@ custom/pnpm-lock.yaml
16
16
  custom/tsconfig.json
17
17
  custom/utils.js
18
18
 
19
- sent 282,653 bytes received 229 bytes 565,764.00 bytes/sec
19
+ sent 282,665 bytes received 229 bytes 565,788.00 bytes/sec
20
20
  total size is 281,759 speedup is 1.00
package/dist/index.js CHANGED
@@ -717,7 +717,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
717
717
  method: 'POST',
718
718
  path: `/plugin/passkeys/registerPasskeyRequest`,
719
719
  noAuth: false,
720
- handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, response, cookies }) {
720
+ handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, response, cookies, headers }) {
721
721
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
722
722
  const mode = body === null || body === void 0 ? void 0 : body.mode;
723
723
  const confirmationResult = body === null || body === void 0 ? void 0 : body.confirmationResult;
@@ -725,7 +725,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
725
725
  adminUser: adminUser,
726
726
  userPk: adminUser.pk,
727
727
  cookies: cookies,
728
- response: response
728
+ response: response,
729
+ extra: {
730
+ headers,
731
+ }
729
732
  });
730
733
  if (!verificationResult || !('ok' in verificationResult)) {
731
734
  return { ok: false, error: 'Verification failed' };
@@ -1015,7 +1018,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
1015
1018
  method: 'POST',
1016
1019
  path: `/plugin/passkeys/resolveVerifyAuto`,
1017
1020
  noAuth: false,
1018
- handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, response, cookies }) {
1021
+ handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, response, cookies, headers }) {
1019
1022
  const sessionId = body === null || body === void 0 ? void 0 : body.sessionId;
1020
1023
  const confirmationResult = body === null || body === void 0 ? void 0 : body.confirmationResult;
1021
1024
  if (!sessionId || !confirmationResult) {
@@ -1026,7 +1029,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
1026
1029
  adminUser: adminUser,
1027
1030
  userPk: adminUser.pk,
1028
1031
  cookies: cookies,
1029
- response: response
1032
+ response: response,
1033
+ extra: {
1034
+ headers: headers,
1035
+ }
1030
1036
  });
1031
1037
  if (!verificationResult || !('ok' in verificationResult)) {
1032
1038
  this.resolveResponse(sessionId, { ok: false, error: 'Verification failed' });
package/index.ts CHANGED
@@ -777,7 +777,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
777
777
  method: 'POST',
778
778
  path: `/plugin/passkeys/registerPasskeyRequest`,
779
779
  noAuth: false,
780
- handler: async ({ body, adminUser, response, cookies }) => {
780
+ handler: async ({ body, adminUser, response, cookies, headers }) => {
781
781
  const mode = body?.mode;
782
782
 
783
783
  const confirmationResult = body?.confirmationResult;
@@ -785,7 +785,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
785
785
  adminUser: adminUser,
786
786
  userPk: adminUser.pk,
787
787
  cookies: cookies,
788
- response: response
788
+ response: response,
789
+ extra: {
790
+ headers,
791
+ } as HttpExtra
789
792
  });
790
793
  if ( !verificationResult || !('ok' in verificationResult) ) {
791
794
  return { ok: false, error: 'Verification failed' };
@@ -1076,7 +1079,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
1076
1079
  method: 'POST',
1077
1080
  path: `/plugin/passkeys/resolveVerifyAuto`,
1078
1081
  noAuth: false,
1079
- handler: async ({ body, adminUser, response, cookies }) => {
1082
+ handler: async ({ body, adminUser, response, cookies, headers }) => {
1080
1083
  const sessionId = body?.sessionId;
1081
1084
  const confirmationResult = body?.confirmationResult;
1082
1085
  if (!sessionId || !confirmationResult) {
@@ -1087,7 +1090,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
1087
1090
  adminUser: adminUser,
1088
1091
  userPk: adminUser.pk,
1089
1092
  cookies: cookies,
1090
- response: response
1093
+ response: response,
1094
+ extra: {
1095
+ headers: headers,
1096
+ } as HttpExtra
1091
1097
  });
1092
1098
  if ( !verificationResult || !('ok' in verificationResult) ) {
1093
1099
  this.resolveResponse(sessionId, { ok: false, error: 'Verification failed' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",