diff --git a/src/oidc.js b/src/oidc.js index 8f79870eb..0ab8d20b8 100644 --- a/src/oidc.js +++ b/src/oidc.js @@ -378,26 +378,38 @@ function renderInteractionPage(provider) { const client = await clientsGet(params.client_id); + let app = null; + if (client.appId) app = await apps.get(client.appId); + switch (prompt.name) { case 'login': { - return res.render('login', { + const options = { submitUrl: `${ROUTE_PREFIX}/interaction/${uid}/login`, + iconUrl: '/api/v1/cloudron/avatar', name: client?.name || 'Cloudron' - }); + }; + + if (app) { + options.name = app.label || app.fqdn; + // options.iconUrl = app.iconUrl; + } + + return res.render('login', options); } case 'consent': { const options = { hasAccess: false, submitUrl: '', + iconUrl: '/api/v1/cloudron/avatar', name: client?.name || '' }; // check if user has access to the app if client refers to an app - if (client.appId) { - const app = await apps.get(client.appId); + if (app) { const user = await users.get(session.accountId); options.name = app.label || app.fqdn; + // options.iconUrl = app.iconUrl; options.hasAccess = apps.canAccess(app, user); } else { options.hasAccess = true; diff --git a/src/oidc_templates/interaction.ejs b/src/oidc_templates/interaction.ejs index 7ac33857c..ed6f13f09 100644 --- a/src/oidc_templates/interaction.ejs +++ b/src/oidc_templates/interaction.ejs @@ -55,7 +55,7 @@