added warnings for empty scopes and empty redirect URI lists

pull/695/head
Justin Richer 2014-10-07 21:43:53 -04:00
parent db052f11ca
commit 793740cf08
2 changed files with 19 additions and 2 deletions

View File

@ -51,11 +51,19 @@
</td>
<td>
<% if (client.redirectUris) { %>
<% if (_.isEmpty(client.redirectUris)) {
if (_.contains(client.grantTypes, 'authorization_code') ||
_.contains(client.grantTypes, 'implicit')) {
%>
<div><span class="badge badge-important"><i class="icon-warning-sign icon-white"></i> NO REDIRECT URI</span></div>
<% }
} else { %>
<div><span class="muted">
<% for (var i in client.redirectUris) {
var uri = $.url(client.redirectUris[i]);
if (uri.attr('protocol') == 'http' && uri.attr('host') != 'localhost') {
if (!uri.attr('protocol')) {
%><b class="text-error" title="unknown protocol scheme">?</b><%
} else if (uri.attr('protocol') == 'http' && uri.attr('host') != 'localhost') {
%><b class="text-error"><%- uri.attr('protocol') %></b>://<%
} else if (uri.attr('protocol') != 'https' && uri.attr('protocol') != 'http') {
%><span class="text-warning"><%- uri.attr('protocol') %></span>://<%

View File

@ -191,6 +191,13 @@
<script type="text/html" id="tmpl-scope-list">
<%
if (_.isEmpty(scopes)) {
%>
<span class="badge badge-important"><i class="icon-warning-sign icon-white"></i> NO SCOPES</span>
<%
} else {
_.each(scopes, function(s) {
var ss = systemScopes.getByValue(s);
@ -215,6 +222,8 @@ style="cursor: default;" >
}
});
}
%>
</script>