import withSession from '../../lib/session'

export default withSession(async (req, res) => {
  req.session.destroy()
  await req.session.save()
  res.json({ isLoggedIn: false })
})

import withSession from '../../lib/session'

export default withSession(async (req, res) => {
  req.session.destroy()
  res.json({ isLoggedIn: false })
})

fix logout in with-iron-session example (#12704)