oidc: reload the login form if the interaction expires

use the error status which the oidc provider module returns
This commit is contained in:
Girish Ramakrishnan
2025-06-13 00:08:54 +02:00
parent 8d57ef2be4
commit 25684bf4f6
2 changed files with 12 additions and 6 deletions
+6 -6
View File
@@ -320,8 +320,11 @@ async function renderError(error) {
return html;
}
async function renderInteractionPage(req, res) {
const { uid, prompt, params, session } = await gOidcProvider.interactionDetails(req, res);
async function renderInteractionPage(req, res, next) {
const [detailsError, details] = await safe(gOidcProvider.interactionDetails(req, res));
if (detailsError) return next(new HttpError(detailsError.statusCode, detailsError.error_description));
const { uid, prompt, params, session } = details;
const client = await oidcClients.get(params.client_id);
if (!client) return res.send(await renderError(new Error('Client not found')));
@@ -384,10 +387,7 @@ async function renderInteractionPage(req, res) {
async function interactionLogin(req, res, next) {
const [detailsError, details] = await safe(gOidcProvider.interactionDetails(req, res));
if (detailsError) {
if (detailsError.error_description === 'interaction session not found') return next(new HttpError(410, 'session timeout'));
return next(new HttpError(400, detailsError));
}
if (detailsError) return next(new HttpError(detailsError.statusCode, detailsError.error_description));
const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || null;
const clientId = details.params.client_id;