@opengis/fastify-table 2.0.3 → 2.0.5
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/server/routes/auth/controllers/2factor/recovery.js +1 -1
- package/dist/server/routes/auth/controllers/2factor/verify.js +1 -1
- package/dist/server/routes/auth/controllers/page/login2faTemplate.js +2 -2
- package/dist/server/routes/auth/controllers/page/loginEuSign.js +1 -1
- package/dist/server/routes/auth/controllers/page/loginTemplate.js +1 -1
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ export default async function recoveryFunction(req, reply) {
|
|
|
43
43
|
// return reply.status(400).send('not enough params');
|
|
44
44
|
const customPt = await getTemplate("pt", template);
|
|
45
45
|
const pt = customPt ||
|
|
46
|
-
(await readFile(path.join(dirname,
|
|
46
|
+
(await readFile(path.join(dirname, `../../../../../templates/pt/${template}.html`), "utf8"));
|
|
47
47
|
const recoveryCodes = await pg
|
|
48
48
|
.query(`select social_auth_obj->'codesArray' as "recoveryCodes" from admin.users_social_auth
|
|
49
49
|
where uid = $1 and social_auth_type = $2`, [uid, "TOTP"])
|
|
@@ -55,7 +55,7 @@ export default async function verifyFunction(req, reply) {
|
|
|
55
55
|
?.then((el) => el.rows?.[0] || {});
|
|
56
56
|
const customPt = await getTemplate("pt", template);
|
|
57
57
|
const pt = customPt ||
|
|
58
|
-
(await readFile(path.join(dirname,
|
|
58
|
+
(await readFile(path.join(dirname, `../../../../../templates/pt/${template}.html`), "utf8"));
|
|
59
59
|
const html = await handlebars.compile(pt)({
|
|
60
60
|
recoveryCodes,
|
|
61
61
|
domain: `${req.protocol || "https"}://${req.hostname}`,
|
|
@@ -29,7 +29,7 @@ export default async function loginTemplate(req, reply) {
|
|
|
29
29
|
if (!userExists && config.pg) {
|
|
30
30
|
return reply.status(400).send("user not found in db");
|
|
31
31
|
}
|
|
32
|
-
const twoFactorPagePath = path.join(dirname, "
|
|
32
|
+
const twoFactorPagePath = path.join(dirname, "../../../../../server/templates/page/2factor.html");
|
|
33
33
|
const customBody = await getTemplate("page", "2factor");
|
|
34
34
|
const body = customBody || (await readFile(twoFactorPagePath, "utf8"));
|
|
35
35
|
const { enabled, secret } = config.pg
|
|
@@ -44,7 +44,7 @@ export default async function loginTemplate(req, reply) {
|
|
|
44
44
|
/* -- access recovery start */
|
|
45
45
|
// user already authorized via euSign / social / login
|
|
46
46
|
if (uid && !req.session?.secondFactorPassed && req.query?.recovery) {
|
|
47
|
-
const defaultPagePath = path.join(dirname, "
|
|
47
|
+
const defaultPagePath = path.join(dirname, "../../../../../server/templates/page/2factor-recovery.html");
|
|
48
48
|
const customBodyRecovery = await getTemplate("page", "2factor-recovery");
|
|
49
49
|
const bodyRecovery = customBodyRecovery || (await readFile(defaultPagePath, "utf8"));
|
|
50
50
|
const html = await handlebars.compile(bodyRecovery)({
|
|
@@ -13,7 +13,7 @@ const headers = {
|
|
|
13
13
|
export default async function loginTemplate(req, reply) {
|
|
14
14
|
const body = await getTemplate("page", "loginEuSign");
|
|
15
15
|
if (!body) {
|
|
16
|
-
const defaultBody = await readFile(path.join(dirname, "
|
|
16
|
+
const defaultBody = await readFile(path.join(dirname, "../../../../templates/page/loginEuSign.html"), "utf8");
|
|
17
17
|
return reply.headers(headers).send(defaultBody);
|
|
18
18
|
}
|
|
19
19
|
return reply.headers(headers).send(body);
|
|
@@ -26,7 +26,7 @@ export default async function loginTemplate(req, reply) {
|
|
|
26
26
|
return p;
|
|
27
27
|
}, {});
|
|
28
28
|
if (!body) {
|
|
29
|
-
const defaultBody = await readFile(path.join(dirname, "
|
|
29
|
+
const defaultBody = await readFile(path.join(dirname, "../../../../templates/page/login.html"), "utf8");
|
|
30
30
|
const html = await handlebars.compile(defaultBody)({
|
|
31
31
|
settings,
|
|
32
32
|
req,
|