Skip to content

Commit

Permalink
fix: conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-michelet committed Sep 22, 2024
2 parents 443026e + 7e524a5 commit 5af92f9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions @types/fastify/fastify.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Auth } from "../../src/schemas/auth.ts";
import { Auth } from '../../src/schemas/auth.ts'

declare module "fastify" {
export interface FastifyRequest {
user: Auth
}
declare module 'fastify' {
export interface FastifyRequest {
user: Auth
}
}
2 changes: 1 addition & 1 deletion @types/node/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ declare global {
}
}

export {};
export {}
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.0.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"eslint": "^9.4.0",
"@types/node": "^22.5.5",
"eslint": "^9.11.0",
"fastify-tsconfig": "^2.0.0",
"mysql2": "^3.10.1",
"mysql2": "^3.11.3",
"neostandard": "^0.11.5",
"tap": "^21.0.1",
"typescript": "^5.4.5"
"typescript": "^5.6.2"
}
}
10 changes: 7 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ export default async function serviceApp (
'Unhandled error occurred'
)

const statusCode = err.statusCode ?? 500
reply.code(statusCode)
reply.code(err.statusCode ?? 500)

return { message: 'Internal Server Error' }
let message = 'Internal Server Error'
if (err.statusCode === 401) {
message = err.message
}

return { message }
})

// An attacker could search for valid URLs if your 404 error handling is not rate limited.
Expand Down

0 comments on commit 5af92f9

Please sign in to comment.