fix approval display

pull/1161/merge
Justin Richer 8 years ago
parent cbf5bf742b
commit f915196c2e

@ -25,7 +25,14 @@
</c:choose>
</h1>
<div><spring:message code="${ approved ? 'device.approve.approved' : 'device.approve.notApproved' }" /></div>
<c:choose>
<c:when test="${ approved }">
<div class="text-success"><i class="icon-ok"></i> <spring:message code="device.approve.approved" /></div>
</c:when>
<c:otherwise>
<div class="text-error"><i class="icon-remove"></i> <spring:message code="device.approve.notApproved" /></div>
</c:otherwise>
</c:choose>
</div>
</div>

@ -41,10 +41,14 @@
<form action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device-user/verify" method="POST">
<div class="row">
<div class="row-fluid">
<div class="span12">
<spring:message code="device.request_code.submit" var="authorize_label"/>
<input type="text" name="user_code" class="input-block-level" />
<div>
<div class="input-block-level input-xlarge">
<input type="text" name="user_code" placeholder="code" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false" value="" />
</div>
</div>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<input name="approve" value="${authorize_label}" type="submit" class="btn btn-info btn-large" />
</div>

@ -244,6 +244,10 @@ public class DeviceEndpoint {
return "requestUserCode";
}
ClientDetailsEntity client = clientService.loadClientByClientId(dc.getClientId());
model.put("client", client);
// user did not approve
if (!approve) {
model.addAttribute("approved", false);
@ -256,10 +260,6 @@ public class DeviceEndpoint {
DeviceCode approvedCode = deviceCodeService.approveDeviceCode(dc, o2Auth);
ClientDetailsEntity client = clientService.loadClientByClientId(dc.getClientId());
model.put("client", client);
// pre-process the scopes
Set<SystemScope> scopes = scopeService.fromStrings(dc.getScope());

Loading…
Cancel
Save