Skip to content

Commit

Permalink
Merge pull request #1 from secretcowlevel/updates-2024-pt1
Browse files Browse the repository at this point in the history
Updates 2024 pt1
  • Loading branch information
framerate authored Mar 27, 2024
2 parents 8b2ad33 + 64b15d5 commit 2be6af4
Show file tree
Hide file tree
Showing 4 changed files with 2,875 additions and 3,345 deletions.
73 changes: 38 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,55 @@
"dev:serve": "nodemon -e js -w dist dist/main.js | pino-pretty",
"dev": "run-p dev:*",
"prod:serve": "node dist/index.js",
"build-clean": "tsc --build --clean"
"build-clean": "tsc --build --clean",
"setup-local-database": "docker run -d --name scl-server-test -p 27888:27017 -e MONGO_INITDB_ROOT_USERNAME=sclmongoadmin -e MONGO_INITDB_ROOT_PASSWORD=m00!m00! mongo",
"clean:install": "rm -f package-lock.json && rm -f yarn.lock && rm -rf node_modules && yarn install"
},
"devDependencies": {
"@babel/preset-typescript": "^7.18.6",
"@hapi/code": "^9.0.2",
"@hapi/lab": "^25.1.0",
"@secretcowlevel/eslint-config-secretcowlevel": "0.0.3",
"@types/bcrypt": "^5.0.0",
"@types/boom": "^7.3.2",
"@babel/preset-typescript": "^7.24.1",
"@hapi/code": "^9.0.3",
"@hapi/lab": "^25.2.0",
"@secretcowlevel/eslint-config-secretcowlevel": "0.0.10",
"@types/bcrypt": "^5.0.2",
"@types/boom": "^7.3.5",
"@types/hapi__hapi": "^20.0.13",
"@types/hapi__inert": "^5.2.5",
"@types/hapi__joi": "^17.1.9",
"@types/hapi__vision": "^5.5.4",
"@types/jest": "^29.4.0",
"@types/hapi__inert": "^5.2.10",
"@types/hapi__joi": "^17.1.14",
"@types/hapi__vision": "^5.5.8",
"@types/jest": "^29.5.12",
"@types/joi": "^17.2.3",
"@types/jsonwebtoken": "^9.0.1",
"@types/node": "^18.13.0",
"@types/uuid": "^9.0.0",
"husky": "^8.0.0",
"jest": "^29.4.1",
"lint-staged": ">=13",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^20.11.30",
"@types/uuid": "^9.0.8",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": ">=15",
"npm-run-all": "^4.1.5",
"pino-pretty": "^9.1.1",
"prettier": "^2.8.3",
"ts-jest": "^29.0.5"
"pino-pretty": "^11.0.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2"
},
"dependencies": {
"@hapi/boom": "^10.0.0",
"@hapi/hapi": "^21.2.1",
"@hapi/inert": "^7.0.0",
"@hapi/vision": "^7.0.0",
"@hapi/boom": "^10.0.1",
"@hapi/hapi": "^21.3.7",
"@hapi/inert": "^7.1.0",
"@hapi/vision": "^7.0.3",
"@types/joi": "^17.2.3",
"@types/mongoose": "^5.11.97",
"bcrypt": "^5.1.0",
"dotenv": "^16.0.3",
"hapi-auth-jwt2": "^10.4.0",
"hapi-pino": "^11.0.1",
"hapi-swagger": "15.0.0",
"bcrypt": "^5.1.1",
"dotenv": "^16.4.5",
"eslint-plugin-prettier": "^5.1.3",
"hapi-auth-jwt2": "^10.5.1",
"hapi-pino": "^12.1.0",
"hapi-swagger": "17.2.1",
"joi": "17.x",
"jsonwebtoken": "^9.0.0",
"mongoose": "^6.9.0",
"nodemon": "^2.0.20",
"pg": "^8.9.0",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.2.3",
"nodemon": "^3.1.0",
"pg": "^8.11.3",
"pg-hstore": "^2.3.4",
"typescript": "^4.9.5",
"uuid": "^9.0.0"
"typescript": "^5.4.3",
"uuid": "^9.0.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const generateToken = (userId: string): string => {
}

const validateToken = async (decoded: DecodedToken): Promise<ValidateTokenResponse> => {
const user = await User.findOne({ _id: decoded.userId })
const user = await User.findById(decoded.userId)

if (user === null) throw Boom.unauthorized()

Expand Down
2 changes: 1 addition & 1 deletion src/routes/health/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface HealthJSON {
}

export const getHealthJson = async (): Promise<HealthJSON> => {
const userCount = await User.count({})
const userCount = await User.countDocuments()

return {
healthy: true,
Expand Down
Loading

0 comments on commit 2be6af4

Please sign in to comment.