Render oidc error page instead of showing a httperror if interaction is invalid
Fixes #862
This commit is contained in:
@@ -291,9 +291,9 @@ async function renderError(error) {
|
||||
return ejs.render(TEMPLATE_ERROR, data);
|
||||
}
|
||||
|
||||
async function renderInteractionPage(req, res, next) {
|
||||
async function renderInteractionPage(req, res) {
|
||||
const [detailsError, details] = await safe(gOidcProvider.interactionDetails(req, res));
|
||||
if (detailsError) return next(new HttpError(detailsError.statusCode, detailsError.error_description));
|
||||
if (detailsError) return res.send(await renderError(new Error('Invalid session')));
|
||||
|
||||
const { uid, prompt, params, session } = details;
|
||||
|
||||
@@ -409,7 +409,8 @@ async function interactionLogin(req, res, next) {
|
||||
}
|
||||
|
||||
async function interactionConfirm(req, res, next) {
|
||||
const interactionDetails = await gOidcProvider.interactionDetails(req, res);
|
||||
const [detailsError, interactionDetails] = await safe(gOidcProvider.interactionDetails(req, res));
|
||||
if (detailsError) return next(new HttpError(detailsError.statusCode, detailsError.error_description));
|
||||
const { grantId, uid, prompt: { name, details }, params, session: { accountId }, lastSubmission } = interactionDetails;
|
||||
|
||||
debug(`route interaction confirm post uid:${uid} prompt.name:${name} accountId:${accountId}`);
|
||||
|
||||
Reference in New Issue
Block a user