Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Use Modinha trim property for client redirect_uris #225

Merged
merged 2 commits into from
Sep 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions models/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,7 @@ var Client = Modinha.define('clients', {
conform: 'Must follow guidelines in OpenID Connect Registration 1.0 ' +
'specification for client metadata'
},
set: function (source) {
// If redirect URIs were given
if (Array.isArray(source.redirect_uris)) {
// Iterate through each one
for (var i = 0; i < source.redirect_uris.length; i++) {
if (typeof source.redirect_uris[i] === 'string') {
// And remove any leading or trailing whitespace
source.redirect_uris[i] = source.redirect_uris[i].trim()
}
}
}
// Lastly, set the new URIs
this.redirect_uris = source.redirect_uris
},
trim: true,
conform: function (value, instance) {
var valid = true
var inDevelopment = process.env.NODE_ENV === 'development' ||
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
"lodash": "^3.8.0",
"mellt": "~1.0.0",
"mkdirp": "^0.5.1",
"modinha": "0.0.32",
"modinha-redis": "0.0.23",
"modinha": "^0.0.33",
"modinha-redis": "^0.0.24",
"nodemailer": "^1.4.0",
"passport-adauth": "^0.1.2",
"passport-ldapauth": "^0.3.0",
Expand Down