From f69a133494b0294af138662c38ce3be991b6b93d Mon Sep 17 00:00:00 2001 From: Tim Shnaider Date: Sat, 17 Feb 2018 10:44:26 +1300 Subject: [PATCH] Don't fail vschar check on state if it is empty and allowEmptyState=1 --- lib/handlers/authorize-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/handlers/authorize-handler.js b/lib/handlers/authorize-handler.js index 984136a8d..ebb4bc903 100644 --- a/lib/handlers/authorize-handler.js +++ b/lib/handlers/authorize-handler.js @@ -221,7 +221,7 @@ AuthorizeHandler.prototype.getState = function(request) { throw new InvalidRequestError('Missing parameter: `state`'); } - if (!is.vschar(state)) { + if (!is.vschar(state) && ((!state || !state.length) && !this.allowEmptyState) || state.length) { throw new InvalidRequestError('Invalid parameter: `state`'); }