Skip to content

Commit

Permalink
Update:Openid auth endpoint sets the mobile flag on session to be use…
Browse files Browse the repository at this point in the history
…d in the callback

Co-authored-by: Denis Arnst <[email protected]>
  • Loading branch information
advplyr and Sapd committed Nov 20, 2023
1 parent aa933df commit 048e27f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ class Auth {
* @param {import('express').Response} 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
res.cookie('is_rest', req.query.isRest.toLowerCase(), {
maxAge: 120000, // 2 min
httpOnly: true
})
} else {
// no isRest-flag set -> set is_rest cookie to false
res.cookie('is_rest', "false", {
res.cookie('is_rest', 'false', {
maxAge: 120000, // 2 min
httpOnly: true
})
Expand Down Expand Up @@ -323,7 +323,8 @@ class Auth {

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
Expand Down

0 comments on commit 048e27f

Please sign in to comment.