@things-factory/auth-base 6.2.30 → 6.2.31
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/router/auth-refresh-token-router.d.ts +1 -0
- package/dist-server/router/auth-refresh-token-router.js +21 -0
- package/dist-server/router/auth-refresh-token-router.js.map +1 -0
- package/dist-server/templates/account-unlock-email.js +2 -1
- package/dist-server/templates/account-unlock-email.js.map +1 -1
- package/dist-server/templates/invitation-email.js +2 -1
- package/dist-server/templates/invitation-email.js.map +1 -1
- package/dist-server/templates/reset-password-email.js +2 -1
- package/dist-server/templates/reset-password-email.js.map +1 -1
- package/dist-server/templates/verification-email.js +2 -1
- package/dist-server/templates/verification-email.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/templates/account-unlock-email.ts +2 -1
- package/server/templates/invitation-email.ts +2 -1
- package/server/templates/reset-password-email.ts +2 -1
- package/server/templates/verification-email.ts +2 -1
@@ -0,0 +1 @@
|
|
1
|
+
export declare const refreshTokenRouter: any;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.refreshTokenRouter = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
|
6
|
+
const jsonwebtoken_1 = tslib_1.__importDefault(require("jsonwebtoken"));
|
7
|
+
const access_token_cookie_1 = require("../utils/access-token-cookie");
|
8
|
+
exports.refreshTokenRouter = new koa_router_1.default();
|
9
|
+
exports.refreshTokenRouter.post('/auth/refresh-token', async (context, next) => {
|
10
|
+
const { user } = context.state;
|
11
|
+
const token = await user.sign();
|
12
|
+
(0, access_token_cookie_1.setAccessTokenCookie)(context, token);
|
13
|
+
const decoded = jsonwebtoken_1.default.decode(token);
|
14
|
+
const expiry = decoded && decoded.exp;
|
15
|
+
context.status = 200;
|
16
|
+
context.body = {
|
17
|
+
token,
|
18
|
+
expiry
|
19
|
+
};
|
20
|
+
});
|
21
|
+
//# sourceMappingURL=auth-refresh-token-router.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"auth-refresh-token-router.js","sourceRoot":"","sources":["../../server/router/auth-refresh-token-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAC/B,wEAA8C;AAE9C,sEAAmE;AAEtD,QAAA,kBAAkB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE9C,0BAAkB,CAAC,IAAI,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE9B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;IAC/B,IAAA,0CAAoB,EAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAEpC,MAAM,OAAO,GAAG,sBAAG,CAAC,MAAM,CAAC,KAAK,CAAe,CAAA;IAC/C,MAAM,MAAM,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAA;IAErC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAA;IACpB,OAAO,CAAC,IAAI,GAAG;QACb,KAAK;QACL,MAAM;KACP,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\nimport jwt, { JwtPayload } from 'jsonwebtoken'\n\nimport { setAccessTokenCookie } from '../utils/access-token-cookie'\n\nexport const refreshTokenRouter = new Router()\n\nrefreshTokenRouter.post('/auth/refresh-token', async (context, next) => {\n const { user } = context.state\n\n const token = await user.sign()\n setAccessTokenCookie(context, token)\n\n const decoded = jwt.decode(token) as JwtPayload\n const expiry = decoded && decoded.exp\n\n context.status = 200\n context.body = {\n token,\n expiry\n }\n})\n"]}
|
@@ -6,10 +6,11 @@ function getUnlockUserEmailForm({ name, resetUrl }) {
|
|
6
6
|
<html lang="en">
|
7
7
|
<head>
|
8
8
|
<meta charset="utf-8" />
|
9
|
-
|
9
|
+
|
10
10
|
<title>reset password</title>
|
11
11
|
<meta name="description" content="Password Reset" />
|
12
12
|
<meta name="author" content="hatiolab" />
|
13
|
+
<meta name="google" content="notranslate"/>
|
13
14
|
</head>
|
14
15
|
|
15
16
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"account-unlock-email.js","sourceRoot":"","sources":["../../server/templates/account-unlock-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,OAAO
|
1
|
+
{"version":3,"file":"account-unlock-email.js","sourceRoot":"","sources":["../../server/templates/account-unlock-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;oBAaF,QAAQ;;;;;;;;;;;;;;;;;GAiBzB,CAAA;AACH,CAAC;AAhED,wDAgEC","sourcesContent":["export function getUnlockUserEmailForm({ name, resetUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>reset password</title>\n <meta name=\"description\" content=\"Password Reset\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Unlock Account</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n Click the button below to unlock account and reset password.\n <br />\n <a\n href=\"${resetUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >unlock account</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
|
@@ -6,10 +6,11 @@ function getInvitationEmailForm({ email, acceptUrl }) {
|
|
6
6
|
<html lang="en">
|
7
7
|
<head>
|
8
8
|
<meta charset="utf-8" />
|
9
|
-
|
9
|
+
|
10
10
|
<title>Invitation from Operato</title>
|
11
11
|
<meta name="description" content="Invitation" />
|
12
12
|
<meta name="author" content="hatiolab" />
|
13
|
+
<meta name="google" content="notranslate"/>
|
13
14
|
</head>
|
14
15
|
|
15
16
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invitation-email.js","sourceRoot":"","sources":["../../server/templates/invitation-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE;IACzD,OAAO
|
1
|
+
{"version":3,"file":"invitation-email.js","sourceRoot":"","sources":["../../server/templates/invitation-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE;IACzD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,KAAK;;;;;;;;;;;;;;oBAcH,SAAS;;;;;;;;;;;;;;;;;GAiB1B,CAAA;AACH,CAAC;AAjED,wDAiEC","sourcesContent":["export function getInvitationEmailForm({ email, acceptUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>Invitation from Operato</title>\n <meta name=\"description\" content=\"Invitation\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${email}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Verify your email</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n You're invited from Operato. \n Simply click the button below to verify your email address.\n <br />\n <a\n href=\"${acceptUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >Verify</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
|
@@ -6,10 +6,11 @@ function getResetPasswordEmailForm({ name, resetUrl }) {
|
|
6
6
|
<html lang="en">
|
7
7
|
<head>
|
8
8
|
<meta charset="utf-8" />
|
9
|
-
|
9
|
+
|
10
10
|
<title>reset password</title>
|
11
11
|
<meta name="description" content="Password Reset" />
|
12
12
|
<meta name="author" content="hatiolab" />
|
13
|
+
<meta name="google" content="notranslate"/>
|
13
14
|
</head>
|
14
15
|
|
15
16
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reset-password-email.js","sourceRoot":"","sources":["../../server/templates/reset-password-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,yBAAyB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1D,OAAO
|
1
|
+
{"version":3,"file":"reset-password-email.js","sourceRoot":"","sources":["../../server/templates/reset-password-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,yBAAyB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;oBAaF,QAAQ;;;;;;;;;;;;;;;;;GAiBzB,CAAA;AACH,CAAC;AAhED,8DAgEC","sourcesContent":["export function getResetPasswordEmailForm({ name, resetUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>reset password</title>\n <meta name=\"description\" content=\"Password Reset\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Reset password</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n Click the button below to reset password.\n <br />\n <a\n href=\"${resetUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >reset password</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
|
@@ -6,10 +6,11 @@ function getVerificationEmailForm({ name, verifyUrl }) {
|
|
6
6
|
<html lang="en">
|
7
7
|
<head>
|
8
8
|
<meta charset="utf-8" />
|
9
|
-
|
9
|
+
|
10
10
|
<title>Verify your email</title>
|
11
11
|
<meta name="description" content="Email Verification" />
|
12
12
|
<meta name="author" content="hatiolab" />
|
13
|
+
<meta name="google" content="notranslate"/>
|
13
14
|
</head>
|
14
15
|
|
15
16
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"verification-email.js","sourceRoot":"","sources":["../../server/templates/verification-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1D,OAAO
|
1
|
+
{"version":3,"file":"verification-email.js","sourceRoot":"","sources":["../../server/templates/verification-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;;oBAcF,SAAS;;;;;;;;;;;;;;;;;GAiB1B,CAAA;AACH,CAAC;AAjED,4DAiEC","sourcesContent":["export function getVerificationEmailForm({ name, verifyUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>Verify your email</title>\n <meta name=\"description\" content=\"Email Verification\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Verify your email</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n You're almost ready to start enjoying Operato. \n Simply click the button below to verify your email address.\n <br />\n <a\n href=\"${verifyUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >Verify</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
|