@opengis/fastify-table 2.0.92 → 2.0.93

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.
@@ -24,11 +24,11 @@ export default async function qrCode(req, reply) {
24
24
  return reply.status(404).send({ error: "invalid user", code: 404 });
25
25
  }
26
26
  const { enabled, secret } = await getSecret({ pg, uid });
27
- const otp = secret
27
+ const { otp } = secret
28
28
  ? await pg
29
- .query(`select social_auth_url
30
- from admin.users_social_auth where uid=$1 and social_auth_type=$2`, [uid, "TOTP"])
31
- ?.then((el) => el.rows?.[0]?.social_auth_url)
29
+ .query(`select social_auth_url as otp from admin.users_social_auth
30
+ where uid=$1 and social_auth_type=$2`, [uid, "TOTP"])
31
+ ?.then((el) => el.rows?.[0] || {})
32
32
  : await generate({ uid, pg });
33
33
  const base64 = otp ? await qr.toDataURL(otp) : undefined;
34
34
  if (enabled && !config.local && !config.debug) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.92",
3
+ "version": "2.0.93",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [