diff --git a/lib/mastodon/routes/oauth.js b/lib/mastodon/routes/oauth.js index 20cd096..2ca8a87 100644 --- a/lib/mastodon/routes/oauth.js +++ b/lib/mastodon/routes/oauth.js @@ -206,6 +206,7 @@ router.get("/oauth/authorize", async (req, res, next) => { code_challenge, code_challenge_method, force_login, + state, } = req.query; // Restore OAuth params from session after login redirect. @@ -221,6 +222,7 @@ router.get("/oauth/authorize", async (req, res, next) => { scope = p.scope; code_challenge = p.code_challenge; code_challenge_method = p.code_challenge_method; + state = p.state; } if (response_type !== "code") { @@ -262,7 +264,7 @@ router.get("/oauth/authorize", async (req, res, next) => { // login redirect chain due to a re-encoding bug in indieauth.js. req.session.pendingOAuth = { client_id, redirect_uri, response_type, scope, - code_challenge, code_challenge_method, + code_challenge, code_challenge_method, state, }; // Redirect to Indiekit's login page with a simple return path. return res.redirect("/session/login?redirect=/oauth/authorize"); @@ -300,6 +302,7 @@ router.get("/oauth/authorize", async (req, res, next) => { +