Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion templates/identity/oidc/consent.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
Do you trust this application
to read and write data on your behalf?
</p>
<dl id="client"></dl>
<div style="display: flex;">
<img id="client_logo" width="40" height="40" style="margin-top: 1em; padding-left: 2em; visibility: collapse;">
<dl id="client" style="text-wrap: nowrap;"></dl>
</div>
<form method="post" id="mainForm">
<fieldset>
<legend>Choose your WebID to authorize</legend>
Expand Down Expand Up @@ -58,6 +61,7 @@
const { client } = await fetchJson(controls.oidc.consent);
showClientInfo('Name', client.client_name);
showClientInfo('ID', client.client_id);
showClientLogo(client.logo_uri, `[${client.client_name} Logo]`);

addPostListener(() => consent(controls));
})();
Expand All @@ -81,6 +85,17 @@
}
}

// Attach client logo to placeholder img
function showClientLogo(src, alt) {
if (src) {
elements.client_logo.src = src
elements.client_logo.style.visibility = "visible"
}
if (alt) {
elements.client_logo.alt = alt
}
}

async function consent(controls) {
// The OIDC provider does not allow us to login and consent at the same time, so these have to be separate calls
const formData = new FormData(elements.mainForm);
Expand Down
Loading