Skip to content

Commit

Permalink
Merge pull request #171 from erydo/client-secret-not-required
Browse files Browse the repository at this point in the history
Fix client_id/client_secret string requirements
  • Loading branch information
jonathansamines authored Feb 15, 2018
2 parents c0f6c6a + 79873bd commit 6a90985
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ const passwordModule = require('./lib/client/password');
const accessTokenModule = require('./lib/client/access-token');
const clientCredentialsModule = require('./lib/client/client');

// https://tools.ietf.org/html/draft-ietf-oauth-v2-31#appendix-A.1
const vsCharRegEx = /^[\x20-\x7E]*$/;

const optionsSchema = Joi
.object()
.keys({
client: Joi.object().keys({
id: Joi.string().required(),
secret: Joi.string().required(),
id: Joi.string().regex(vsCharRegEx).allow(''),
secret: Joi.string().regex(vsCharRegEx).allow(''),
secretParamName: Joi.string().default('client_secret'),
idParamName: Joi.string().default('client_id'),
}).required(),
Expand Down

0 comments on commit 6a90985

Please # to comment.