From cbb480c841629107901a4270942c1e48b0e4bbd9 Mon Sep 17 00:00:00 2001 From: Ananay Arora Date: Wed, 10 Jun 2020 09:23:54 -0700 Subject: [PATCH] Revert "Revert "Allow setting of the state parameter"" --- src/strategy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy.js b/src/strategy.js index 3cbc8d6..d205259 100644 --- a/src/strategy.js +++ b/src/strategy.js @@ -128,11 +128,11 @@ Strategy.prototype.authenticate = function (req, options) { * @access protected */ Strategy.prototype.authorizationParams = function (options) { - options.state = crypto.randomBytes(5).toString('hex'); + options.state = options.state || crypto.randomBytes(5).toString('hex'); options.response_type = "code id_token"; options.scope = "name email"; options.response_mode = "form_post"; return options; } -module.exports = Strategy; \ No newline at end of file +module.exports = Strategy;