redirect uri with new name

pull/306/merge
Justin Richer 2013-03-04 16:49:17 -05:00
parent 9aebca2e97
commit 7c3ddd0a86
2 changed files with 10 additions and 9 deletions

View File

@ -20,7 +20,7 @@ var ClientModel = Backbone.Model.extend({
idTokenValiditySeconds: 600, idTokenValiditySeconds: 600,
clientName:"", clientName:"",
clientSecret:"", clientSecret:"",
registeredRedirectUri:[], redirectUris:[],
authorizedGrantTypes:["authorization_code"], authorizedGrantTypes:["authorization_code"],
scope:[], scope:[],
authorities:[], authorities:[],
@ -198,7 +198,7 @@ var ClientFormView = Backbone.View.extend({
this.template = _.template($('#tmpl-client-form').html()); this.template = _.template($('#tmpl-client-form').html());
} }
this.registeredRedirectUriCollection = new Backbone.Collection(); this.redirectUrisCollection = new Backbone.Collection();
this.scopeCollection = new Backbone.Collection(); this.scopeCollection = new Backbone.Collection();
}, },
@ -353,7 +353,7 @@ var ClientFormView = Backbone.View.extend({
clientId:$('#clientId input').val(), clientId:$('#clientId input').val(),
clientSecret: clientSecret, clientSecret: clientSecret,
generateClientSecret:generateClientSecret, generateClientSecret:generateClientSecret,
registeredRedirectUri: this.registeredRedirectUriCollection.pluck("item"), redirectUris: this.redirectUrisCollection.pluck("item"),
clientDescription:$('#clientDescription textarea').val(), clientDescription:$('#clientDescription textarea').val(),
logoUrl:$('#logoUrl input').val(), logoUrl:$('#logoUrl input').val(),
authorizedGrantTypes: authorizedGrantTypes, authorizedGrantTypes: authorizedGrantTypes,
@ -362,7 +362,8 @@ var ClientFormView = Backbone.View.extend({
idTokenValiditySeconds: idTokenValiditySeconds, idTokenValiditySeconds: idTokenValiditySeconds,
allowRefresh: $('#allowRefresh').is(':checked'), allowRefresh: $('#allowRefresh').is(':checked'),
allowIntrospection: $('#allowIntrospection input').is(':checked'), allowIntrospection: $('#allowIntrospection input').is(':checked'),
scope: scopes scope: scopes,
}); });
// post-validate // post-validate
@ -408,12 +409,12 @@ var ClientFormView = Backbone.View.extend({
var _self = this; var _self = this;
// build and bind registered redirect URI collection and view // build and bind registered redirect URI collection and view
_.each(this.model.get("registeredRedirectUri"), function (registeredRedirectUri) { _.each(this.model.get("redirectUris"), function (redirectUri) {
_self.registeredRedirectUriCollection.add(new URIModel({item:registeredRedirectUri})); _self.redirectUrisCollection.add(new URIModel({item:redirectUri}));
}); });
$("#registeredRedirectUri .controls",this.el).html(new ListWidgetView({type:'uri', placeholder: 'http://', $("#redirectUris .controls",this.el).html(new ListWidgetView({type:'uri', placeholder: 'http://',
collection: this.registeredRedirectUriCollection}).render().el); collection: this.redirectUrisCollection}).render().el);
_self = this; _self = this;
// build and bind scopes // build and bind scopes

View File

@ -97,7 +97,7 @@
</div> </div>
</div> </div>
<div class="control-group" id="registeredRedirectUri"> <div class="control-group" id="redirectUris">
<label class="control-label">Redirect URI(s)</label> <label class="control-label">Redirect URI(s)</label>
<div class="controls"> <div class="controls">
</div> </div>