@adminforth/login-captcha 1.1.21 → 1.1.23

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
@@ -7,5 +7,5 @@ custom/
7
7
  custom/CaptchaWidget.vue
8
8
  custom/tsconfig.json
9
9
 
10
- sent 2,104 bytes received 58 bytes 4,324.00 bytes/sec
10
+ sent 2,101 bytes received 58 bytes 4,318.00 bytes/sec
11
11
  total size is 1,887 speedup is 0.87
package/dist/index.js CHANGED
@@ -86,6 +86,9 @@ export default class CaptchaPlugin extends AdminForthPlugin {
86
86
  noAuth: true,
87
87
  handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, response }) {
88
88
  const { token } = body;
89
+ if (!token) {
90
+ return { ok: false, error: 'Token is required' };
91
+ }
89
92
  const adapter = this.options.captchaAdapter;
90
93
  const adapterName = adapter.constructor.name;
91
94
  response.setHeader('Set-Cookie', `adminforth_${adapterName}_temporaryJWT=${token}; Path=${this.adminforth.config.baseUrl || '/'}; HttpOnly; SameSite=Strict; max-age=300; `);
package/index.ts CHANGED
@@ -94,6 +94,10 @@ export default class CaptchaPlugin extends AdminForthPlugin {
94
94
  handler: async ({ body, response }) => {
95
95
  const { token } = body;
96
96
 
97
+ if (!token) {
98
+ return { ok: false, error: 'Token is required' };
99
+ }
100
+
97
101
  const adapter = this.options.captchaAdapter;
98
102
  const adapterName = adapter.constructor.name;
99
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/login-captcha",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -1,2 +1,4 @@
1
1
  allowBuilds:
2
2
  adminforth: true
3
+ minimumReleaseAgeExclude:
4
+ - adminforth