@adminforth/two-factors-auth 2.10.8 → 2.10.9

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
@@ -107,6 +107,14 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
107
107
  var _a, _b, _c, _d, _e, _f;
108
108
  if (!confirmationResult)
109
109
  return { error: "Confirmation result is required" };
110
+ if (!opts.adminUser)
111
+ return { error: "Admin user is required" };
112
+ if (!opts.userPk)
113
+ return { error: "User PK is required" };
114
+ if (!opts.response)
115
+ return { error: "Response object is required" };
116
+ if (!opts.cookies)
117
+ return { error: "Cookies are required" };
110
118
  if (!(opts === null || opts === void 0 ? void 0 : opts.cookies)) {
111
119
  opts.cookies = (_a = opts.extra) === null || _a === void 0 ? void 0 : _a.cookies;
112
120
  }
package/index.ts CHANGED
@@ -116,6 +116,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
116
116
  opts?: { adminUser?: AdminUser; userPk?: string; cookies?: any, response?: IAdminForthHttpResponse, extra?: HttpExtra }
117
117
  ): Promise<{ ok: true } | { error: string }> {
118
118
  if (!confirmationResult) return { error: "Confirmation result is required" };
119
+ if (!opts.adminUser) return { error: "Admin user is required" };
120
+ if (!opts.userPk) return { error: "User PK is required" };
121
+ if (!opts.response) return { error: "Response object is required" };
122
+ if (!opts.cookies) return { error: "Cookies are required" };
119
123
  if (!opts?.cookies) {
120
124
  opts.cookies = opts.extra?.cookies;
121
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "2.10.8",
3
+ "version": "2.10.9",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",