@opengis/fastify-table 2.4.13 → 2.4.14

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.
@@ -7,13 +7,13 @@ function errorStatus(error) {
7
7
  return 422;
8
8
  }
9
9
  if (error.routine === "exec_stmt_raise" && error.file === "pl_exec.c") {
10
- return 601;
10
+ return 422;
11
11
  }
12
12
  if (error.routine === "ExecConstraints") {
13
- return 602;
13
+ return 422;
14
14
  }
15
15
  if (error.type === "DatabaseError") {
16
- return 600;
16
+ return 500;
17
17
  }
18
18
  if (error.statusCode) {
19
19
  return error.statusCode;
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../../../server/routes/auth/controllers/2factor/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA2BvC;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAA8B,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,kBAyDzE"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../../../server/routes/auth/controllers/2factor/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA2BvC;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAA8B,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,kBA2DzE"}
@@ -67,8 +67,9 @@ export default async function verifyFunction(req, reply) {
67
67
  });
68
68
  }
69
69
  const redirectUrl = req.headers?.referer?.match?.(/[?&]redirect=([^&]+)/)?.[1] || "/";
70
- // return reply.redirect(redirectUrl.startsWith("/") ? redirectUrl : "/");
71
- return reply
72
- .status(200)
73
- .send({ redirectUrl: redirectUrl.startsWith("/") ? redirectUrl : "/" });
70
+ const safeRedirectUrl = redirectUrl.startsWith("/") ? redirectUrl : "/";
71
+ if (req.method === "POST") {
72
+ return reply.status(200).send({ redirectUrl: safeRedirectUrl });
73
+ }
74
+ return reply.redirect(safeRedirectUrl);
74
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.4.13",
3
+ "version": "2.4.14",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [