Add validation for oauth password flow

This commit is contained in:
TANAKA Koichi
2016-11-12 22:44:27 +09:00
parent 7cdf83a932
commit f2a1caa379
2 changed files with 20 additions and 1 deletions

View File

@@ -38,6 +38,11 @@ SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
validate: function () {
var valid = false;
if (this.get('isPasswordFlow') &&
(!this.get('username'))) {
return false;
}
var scp = this.get('scopes');
var idx = _.findIndex(scp, function (o) {
return o.checked === true;