@stanlemon/server-with-auth 0.3.19 → 0.3.20
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/eslint.config.js +1 -0
- package/package.json +4 -4
- package/src/createAppServer.js +2 -2
- package/src/routes/auth.js +1 -1
- package/src/routes/auth.test.js +0 -1
package/eslint.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@stanlemon/eslint-config";
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanlemon/server-with-auth",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "A basic express web server setup with authentication baked in.",
|
|
5
5
|
"author": "Stan Lemon <stanlemon@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=20.0"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "./src/index.js",
|
|
12
12
|
"exports": "./src/index.js",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"start": "NODE_ENV=development nodemon --ignore db.json ./app.js",
|
|
15
|
-
"lint": "eslint
|
|
16
|
-
"lint:fix": "eslint --fix
|
|
15
|
+
"lint": "eslint .",
|
|
16
|
+
"lint:fix": "eslint --fix .",
|
|
17
17
|
"test": "jest --detectOpenHandles",
|
|
18
18
|
"test:coverage": "jest --detectOpenHandles --coverage",
|
|
19
19
|
"test:watch": "jest --detectOpenHandles --watch"
|
package/src/createAppServer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from "node:events";
|
|
2
|
-
import
|
|
2
|
+
import { config } from "dotenv";
|
|
3
3
|
import {
|
|
4
4
|
createAppServer as createBaseAppServer,
|
|
5
5
|
DEFAULTS as BASE_DEFAULTS,
|
|
@@ -16,7 +16,7 @@ import UserDao from "./data/user-dao.js";
|
|
|
16
16
|
import checkUserDao from "./utilities/checkUserDao.js";
|
|
17
17
|
import checkSchemas from "./utilities/checkSchemas.js";
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
config();
|
|
20
20
|
|
|
21
21
|
export const DEFAULTS = {
|
|
22
22
|
...BASE_DEFAULTS,
|
package/src/routes/auth.js
CHANGED
|
@@ -69,7 +69,7 @@ export default function authRoutes({
|
|
|
69
69
|
|
|
70
70
|
router.post(ROUTES.LOGIN, (req, res, next) => {
|
|
71
71
|
// Customizing the login so we can send a proper JSON response when unable to login
|
|
72
|
-
passport.authenticate("local", (err, user
|
|
72
|
+
passport.authenticate("local", (err, user) => {
|
|
73
73
|
if (err) {
|
|
74
74
|
return next(err);
|
|
75
75
|
}
|
package/src/routes/auth.test.js
CHANGED
|
@@ -26,7 +26,6 @@ process.env.NODE_ENV = "test";
|
|
|
26
26
|
|
|
27
27
|
describe("/auth", () => {
|
|
28
28
|
// Disabling this linting rule because it is unaware of the supertest assertions
|
|
29
|
-
/* eslint-disable jest/expect-expect */
|
|
30
29
|
it("POST /signup creates a user", async () => {
|
|
31
30
|
const username = "test" + uuidv4();
|
|
32
31
|
const password = "p@$$w0rd!";
|