Skip to content

Commit ed59059

Browse files
fix(auth): respond meaningful message on failure
1 parent 9084372 commit ed59059

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default fp<AuthPluginOptions>(async (fastify, opts) => {
122122
return reply
123123
.status(401)
124124
.type("application/json")
125-
.send(e.response.body?.toString());
125+
.send(await e.response.json());
126126
}
127127
throw e;
128128
}

0 commit comments

Comments
 (0)