From 0cb28a1bcc3aa3fdaa24f313a604632bcecfe6df Mon Sep 17 00:00:00 2001 From: Code002Lover Arch Laptop Date: Tue, 7 Mar 2023 10:58:10 +0100 Subject: [PATCH] add extra data parameter --- routes/authorize.js | 6 +++++- views/authorize.html | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/routes/authorize.js b/routes/authorize.js index 80be746..fa5e769 100644 --- a/routes/authorize.js +++ b/routes/authorize.js @@ -45,7 +45,11 @@ export const setup = function (router, con, server) { res.redirect(`/authorize?id=${req.body.application_id}`) return } - res.redirect(`${result[0].application_auth_url}?code=${tokencode}`) + let extra = "" + if(req.body.application_extra !== "") { + extra = "&extra="+String(req.body.application_extra) + } + res.redirect(`${result[0].application_auth_url}?code=${tokencode}${extra}`) }) diff --git a/views/authorize.html b/views/authorize.html index 7ab24a4..6f81e25 100644 --- a/views/authorize.html +++ b/views/authorize.html @@ -27,6 +27,7 @@

Please authorize the app "<%= application.application_name %>" to access your information:

class="hidden" name="application_id" id="application_id"> + class="hidden" name="application_extra" id="application_extra">