web/flows: simplify consent's permission handling
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
fb5eb7b868
commit
ab25216c1f
|
@ -37,13 +37,15 @@ export class ConsentStage extends BaseStage<ConsentChallenge, ConsentChallengeRe
|
|||
}
|
||||
|
||||
renderPermissions(perms: Permission[]): TemplateResult {
|
||||
const shouldShowId = perms.filter((perm) => perm.name === "").length === perms.length;
|
||||
return html`${perms.map((permission) => {
|
||||
let name = permission.name;
|
||||
if (permission.name === "" && shouldShowId) {
|
||||
name = permission.id;
|
||||
if (permission.name === "") {
|
||||
return html``;
|
||||
}
|
||||
return html`<li data-permission-code="${permission.id}">${name}</li>`;
|
||||
// Special case for openid Scope
|
||||
if (permission.id === "openid") {
|
||||
return html``;
|
||||
}
|
||||
return html`<li data-permission-code="${permission.id}">${permission.name}</li>`;
|
||||
})}`;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue