Skip to content

Commit

Permalink
chore(ci): refactor logging
Browse files Browse the repository at this point in the history
  • Loading branch information
conradbekondo committed Jan 13, 2025
1 parent 25ff869 commit 2b19ede
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/handlers/auth.mts
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ export async function handleTokenRefresh(req: Request, res: Response) {
try {
logger.info('refreshing tokens');
const { success, data, error } = RefreshTokenValidationSchema.safeParse(req.query);
console.log(JSON.stringify(error));

if (!success) {
logger.error("refresh token validation error", { error });
res.status(403).json({ message: 'Invalid refresh token' });
return;
}
Expand Down
2 changes: 1 addition & 1 deletion server/helpers/error.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function handleError(err: Error, res: Response) {
if (err instanceof ZodError) {
res.status(400).json({ message: fromError(err).message });
} else {
defaultLogger.error('handled error', 'error', err);
defaultLogger.error('handled error', { error: err });
res.status(500).json({ message: 'Internal server error' });
}
}

0 comments on commit 2b19ede

Please sign in to comment.