Skip to content

Commit 5af92f9

Browse files
committed
fix: conflicts
2 parents 443026e + 7e524a5 commit 5af92f9

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

@types/fastify/fastify.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Auth } from "../../src/schemas/auth.ts";
1+
import { Auth } from '../../src/schemas/auth.ts'
22

3-
declare module "fastify" {
4-
export interface FastifyRequest {
5-
user: Auth
6-
}
3+
declare module 'fastify' {
4+
export interface FastifyRequest {
5+
user: Auth
6+
}
77
}

@types/node/environment.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ declare global {
1313
}
1414
}
1515

16-
export {};
16+
export {}

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@
4949
"react-dom": "^18.3.1"
5050
},
5151
"devDependencies": {
52-
"@types/node": "^22.0.0",
53-
"@types/react": "^18.3.4",
54-
"@types/react-dom": "^18.3.0",
55-
"eslint": "^9.4.0",
52+
"@types/node": "^22.5.5",
53+
"eslint": "^9.11.0",
5654
"fastify-tsconfig": "^2.0.0",
57-
"mysql2": "^3.10.1",
55+
"mysql2": "^3.11.3",
5856
"neostandard": "^0.11.5",
5957
"tap": "^21.0.1",
60-
"typescript": "^5.4.5"
58+
"typescript": "^5.6.2"
6159
}
6260
}

src/app.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ export default async function serviceApp (
6060
'Unhandled error occurred'
6161
)
6262

63-
const statusCode = err.statusCode ?? 500
64-
reply.code(statusCode)
63+
reply.code(err.statusCode ?? 500)
6564

66-
return { message: 'Internal Server Error' }
65+
let message = 'Internal Server Error'
66+
if (err.statusCode === 401) {
67+
message = err.message
68+
}
69+
70+
return { message }
6771
})
6872

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

0 commit comments

Comments
 (0)