From cf1ea362cdbbde9ff67f1765da8b3fb9390fe188 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Tue, 14 Sep 2021 23:38:35 -0500 Subject: [PATCH] Update flitter-auth & fix state search params --- app/controllers/auth/Oauth2.controller.js | 5 ++--- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/controllers/auth/Oauth2.controller.js b/app/controllers/auth/Oauth2.controller.js index 3666bb1..b20d6fa 100644 --- a/app/controllers/auth/Oauth2.controller.js +++ b/app/controllers/auth/Oauth2.controller.js @@ -69,9 +69,8 @@ class Oauth2 extends Oauth2Controller { let state; if ( state = (req.query.state || req.body.state) ) { - state = Array.isArray(req.query.state) ? req.query.state[0] : req.query.state - const uri_params = new URLSearchParams(uri.params) - uri_params.set('state', state) + state = Array.isArray(state) ? state[0] : state + uri.searchParams.set('state', state) } if ( req.user.has_authorized(starship_client) ) { diff --git a/package.json b/package.json index 264cd05..5f9cbac 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "dependencies": { "bullmq": "^1.8.8", "email-validator": "^2.0.4", - "flitter-auth": "^0.19.4", + "flitter-auth": "^0.19.5", "flitter-cli": "^0.16.0", "flitter-di": "^0.5.0", "flitter-flap": "^0.5.2", diff --git a/yarn.lock b/yarn.lock index a920e18..05aba3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2059,10 +2059,10 @@ flat@^4.1.0: dependencies: is-buffer "~2.0.3" -flitter-auth@^0.19.4: - version "0.19.4" - resolved "https://registry.yarnpkg.com/flitter-auth/-/flitter-auth-0.19.4.tgz#340765b03bf28c9f1b6c7095b50b6ba791c0b7ee" - integrity sha512-J0tpYPS/7XfksNu9fQ6AM4IdB/VuiVcU8d3Zi+YYgQa7/cRNEuUlnGfNyhK8yp6r35AdAWypJ3xV9XBLM9/cSQ== +flitter-auth@^0.19.5: + version "0.19.5" + resolved "https://registry.yarnpkg.com/flitter-auth/-/flitter-auth-0.19.5.tgz#590061b7c6ed9f4703fcc7b6511521a42b48c826" + integrity sha512-zmkoxTLj1TqHHrCezu7jfWvvDmIV9zdsG+kDRjQ2flCD5+LYdvLUwGM2nQ1wVSp9CHVuG75MJju6IMeUaxT7Hw== dependencies: axios "^0.19.0" bcrypt "^3.0.4"