Skip to content

Commit

Permalink
add await logout url
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitSerrano committed May 28, 2024
1 parent 1daf23e commit afa3e4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ module.exports.startAuth = async (req, res) => {
res.redirect(authRequest.redirectUrl)
}

module.exports.logout = async(req, res) => {
module.exports.logout = async (req, res) => {
const user = req.session.user
console.log("USER")
console.log(user)
if(!user){
return res.redirect(urls.landing)
}
const {id_token_hint, state} = user
req.session.destroy()

const logoutUrl = oidcAuth.getLogoutUrl({id_token_hint, state})
const logoutUrl = await oidcAuth.getLogoutUrl({id_token_hint, state})
console.log("LOGOUT", logoutUrl)
return res.redirect(logoutUrl)
}

0 comments on commit afa3e4b

Please sign in to comment.