@devmoods/express-extras 0.22.0 → 0.22.2
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/auth.js +2 -3
- package/dist/middleware.js +2 -1
- package/package.json +14 -13
package/dist/auth.js
CHANGED
|
@@ -69,8 +69,7 @@ export function createAuth({ getUserByToken, methods: { emailAndPassword }, filt
|
|
|
69
69
|
properties: { token: tokenSchema, password: passwordSchema },
|
|
70
70
|
required: ['token', 'password'],
|
|
71
71
|
}), route(async (req) => {
|
|
72
|
-
const { password } = req.body;
|
|
73
|
-
const { token } = req.params;
|
|
72
|
+
const { password, token } = req.body;
|
|
74
73
|
const email = await redis.get(token);
|
|
75
74
|
if (!email) {
|
|
76
75
|
logger.info('invalid reset token', { token });
|
|
@@ -117,7 +116,7 @@ export function createAuth({ getUserByToken, methods: { emailAndPassword }, filt
|
|
|
117
116
|
properties: { token: tokenSchema },
|
|
118
117
|
required: ['token'],
|
|
119
118
|
}), route(async (req) => {
|
|
120
|
-
const token = req.params
|
|
119
|
+
const { token } = req.params;
|
|
121
120
|
const email = await redis.get(token);
|
|
122
121
|
if (!email) {
|
|
123
122
|
logger.info('invalid reset token', { token });
|
package/dist/middleware.js
CHANGED
|
@@ -19,6 +19,7 @@ export function before({ cookies = false, helmet: useHelmet = true, json: useJso
|
|
|
19
19
|
logRequestDuration(),
|
|
20
20
|
Sentry.Handlers.requestHandler(),
|
|
21
21
|
Sentry.Handlers.tracingHandler(),
|
|
22
|
+
analyticsProxy(),
|
|
22
23
|
useHelmet &&
|
|
23
24
|
helmet({
|
|
24
25
|
contentSecurityPolicy: {
|
|
@@ -102,7 +103,7 @@ function analyticsProxy() {
|
|
|
102
103
|
* Register middlewares that must come after the app routes.
|
|
103
104
|
*/
|
|
104
105
|
export function after() {
|
|
105
|
-
return compose([
|
|
106
|
+
return compose([notFound()]);
|
|
106
107
|
}
|
|
107
108
|
/**
|
|
108
109
|
* Alias of `route()`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devmoods/express-extras",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "Kubernetes-ready utilities for rapid Node.js application development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"migrate": "bin/migrate"
|
|
10
10
|
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "ts-node --esm example/index.ts",
|
|
13
|
+
"start:worker": "ts-node --esm example/worker.ts",
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"lint": "eslint src",
|
|
16
|
+
"test": "NODE_ENV=test vitest",
|
|
17
|
+
"build": "pnpm run clean && tsc --project tsconfig.build.json",
|
|
18
|
+
"prepublishOnly": "pnpm run clean && pnpm run build",
|
|
19
|
+
"prettier": "prettier --write '**/*.{js,css,md,ts,tsx}'",
|
|
20
|
+
"import-sort": "import-sort --write '**/*.{js,jsx,ts,tsx}'",
|
|
21
|
+
"format": "pnpm run import-sort && pnpm run prettier"
|
|
22
|
+
},
|
|
11
23
|
"author": {
|
|
12
24
|
"name": "hanse",
|
|
13
25
|
"email": "hanse@koren.im"
|
|
@@ -94,16 +106,5 @@
|
|
|
94
106
|
},
|
|
95
107
|
"peerDependencies": {
|
|
96
108
|
"faktory-worker": "^4.5.1"
|
|
97
|
-
},
|
|
98
|
-
"scripts": {
|
|
99
|
-
"start": "ts-node --esm example/index.ts",
|
|
100
|
-
"start:worker": "ts-node --esm example/worker.ts",
|
|
101
|
-
"clean": "rm -rf dist",
|
|
102
|
-
"lint": "eslint src",
|
|
103
|
-
"test": "NODE_ENV=test vitest",
|
|
104
|
-
"build": "pnpm run clean && tsc --project tsconfig.build.json",
|
|
105
|
-
"prettier": "prettier --write '**/*.{js,css,md,ts,tsx}'",
|
|
106
|
-
"import-sort": "import-sort --write '**/*.{js,jsx,ts,tsx}'",
|
|
107
|
-
"format": "pnpm run import-sort && pnpm run prettier"
|
|
108
109
|
}
|
|
109
|
-
}
|
|
110
|
+
}
|