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

Commit

Permalink
fix(api): tolerate an empty client_secret in /destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
philbooth committed Jun 30, 2015
1 parent c797ed2 commit 25a4d30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/routes/destroy.js
Expand Up @@ -17,7 +17,7 @@ module.exports = {
.length(config.get('unique.token') * 2) // hex = bytes*2
.regex(validators.HEX_STRING)
.required(),
client_secret: Joi.string()
client_secret: Joi.string().allow('')
}
},
handler: function destroyToken(req, reply) {
Expand Down
13 changes: 13 additions & 0 deletions test/api.js
Expand Up @@ -1455,5 +1455,18 @@ describe('/v1', function() {
assert.equal(res.statusCode, 200);
});
});
it('should accept empty client_secret', function() {
return newToken().then(function(res) {
return Server.api.post({
url: '/destroy',
payload: {
token: res.result.access_token,
client_secret: ''
}
});
}).then(function(res) {
assert.equal(res.statusCode, 200);
});
});
});
});

0 comments on commit 25a4d30

Please sign in to comment.