Implement OAuth2 password flow

This commit is contained in:
TANAKA Koichi
2016-09-10 17:32:55 +09:00
parent 776325b993
commit 7cdf83a932
5 changed files with 60 additions and 7 deletions

View File

@@ -2,7 +2,8 @@
SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
defaults: {
scopes: {}
scopes: {},
isPasswordFlow: false
},
initialize: function () {
@@ -19,6 +20,8 @@ SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
attributes.scopes = scopes;
this.attributes = attributes;
}
this.set('isPasswordFlow', attributes.flow && attributes.flow === 'password');
this.on('change', this.validate);
},