Expand on what each scope means during user consent

This commit is contained in:
Andreas Svanberg 2025-04-23 12:27:01 +02:00
parent e826ce523d
commit efcfddaa70
Signed by: ansv7779
GPG Key ID: 729B051CFFD42F92
2 changed files with 32 additions and 4 deletions
src/main/resources/templates

@ -30,10 +30,7 @@
</li>
@for (var scope : scopes)
<li class="list-group-item">
<input class="form-check-input" type="checkbox" name="scope" value="${scope}" id="scope_${scope}" checked>
<label class="form-check-label" for="scope_${scope}">
${scope}
</label>
@template.consent_scope(scope = scope)
</li>
@endfor
</ul>

@ -0,0 +1,31 @@
@import java.util.Objects
@param String scope
<label class="d-flex gap-3">
<input class="form-check-input flex-shrink-0" type="checkbox" name="scope" value="${scope}" id="scope_${scope}" checked aria-label="${scope}">
@if (Objects.equals("profile", scope))
<dl>
<dt>Given name</dt>
<dd>...</dd>
<dt>Family name</dt>
<dd>...</dd>
<dt>Display name</dt>
<dd>...</dd>
</dl>
@elseif (Objects.equals("email", scope))
<dl>
<dt>E-mail address</dt>
<dd>...</dd>
</dl>
@elseif (Objects.equals("offline_access", scope))
<div>Maintain access after you leave the application</div>
@else
<div>${scope}</div>
@endif
<div class="ms-auto">
<small class="text-muted">scope: ${scope}</small>
</div>
</label>