Skip to content

Commit

Permalink
Log service error in oidc/saml response paths
Browse files Browse the repository at this point in the history
  • Loading branch information
niwsa committed Dec 18, 2024
1 parent 0665e08 commit cd7045b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/oauth/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
res.send(response_form);
}
} catch (err: any) {
console.error('callback error:', err);
const { message, statusCode = 500 } = err;
console.error('OIDC IdP response processing error:', message);
// set error in cookie redirect to error page
setErrorCookie(res, { message, statusCode }, { path: '/error' });
res.redirect(302, '/error');
Expand Down
1 change: 1 addition & 0 deletions pages/api/oauth/saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}
} catch (error: any) {
const { message, statusCode = 500 } = error;
console.error('SAML IdP response processing error:', message);

setErrorCookie(res, { message, statusCode }, { path: '/error' });

Expand Down

0 comments on commit cd7045b

Please sign in to comment.