Update:Openid auth endpoint sets the mobile flag on session to be used in the callback

Co-authored-by: Denis Arnst <git@sapd.eu>
This commit is contained in:
advplyr 2023-11-20 15:41:38 -06:00
parent aa933df525
commit 048e27f03f

View File

@ -187,7 +187,7 @@ class Auth {
* @param {import('express').Response} res * @param {import('express').Response} res
*/ */
paramsToCookies(req, res) { paramsToCookies(req, res) {
if (req.query.isRest?.toLowerCase() == "true") { if (req.query.isRest?.toLowerCase() == 'true') {
// store the isRest flag to the is_rest cookie // store the isRest flag to the is_rest cookie
res.cookie('is_rest', req.query.isRest.toLowerCase(), { res.cookie('is_rest', req.query.isRest.toLowerCase(), {
maxAge: 120000, // 2 min maxAge: 120000, // 2 min
@ -195,7 +195,7 @@ class Auth {
}) })
} else { } else {
// no isRest-flag set -> set is_rest cookie to false // no isRest-flag set -> set is_rest cookie to false
res.cookie('is_rest', "false", { res.cookie('is_rest', 'false', {
maxAge: 120000, // 2 min maxAge: 120000, // 2 min
httpOnly: true httpOnly: true
}) })
@ -323,7 +323,8 @@ class Auth {
req.session[sessionKey] = { req.session[sessionKey] = {
...req.session[sessionKey], ...req.session[sessionKey],
...pick(params, 'nonce', 'state', 'max_age', 'response_type') ...pick(params, 'nonce', 'state', 'max_age', 'response_type'),
mobile: req.query.isRest?.toLowerCase() === 'true' // Used in the abs callback later
} }
// Now get the URL to direct to // Now get the URL to direct to