index.js
function _logout (cookieName, cookieDomain) {
  return (req, res) => {
    const cookies = new Cookies(req, res)
    cookies.set(cookieName, null, { domain: cookieDomain })
    cookies.set(cookieName + '_sign', null, { domain: cookieDomain })
    // case where the cookies were set before assigning domain
    if (cookies.get(cookieName)) {
      cookies.set(cookieName, null)
      cookies.set(cookieName + '_sign', null)
    }
    res.status(204).send()
  }
}
function _logout (cookieName, cookieDomain) {
  return (req, res) => {
    const cookies = new Cookies(req, res)
    cookies.set(cookieName, null, { domain: cookieDomain })
    cookies.set(cookieName + '_sign', null, { domain: cookieDomain })
    // case where the cookies were set before assigning domain
    if (cookies.get(cookieName)) {
      cookies.set(cookieName, null)
      cookies.set(cookieName + '_sign', null)
    }
    res.status(204).send()
  }
}
function _logout ( cookieName , cookieDomain ) { return ( req , res ) => { const cookies = new Cookies ( req , res ) cookies . set ( cookieName , null , { domain : cookieDomain } ) cookies . set ( cookieName + '_sign' , null , { domain : cookieDomain } ) // case where the cookies were set before assigning domain if ( cookies . get ( cookieName ) ) { cookies . set ( cookieName , null ) cookies . set ( cookieName + '_sign' , null ) } res . status ( 204 ) . send ( ) } }
Sessions are only the persistence of the JWT token in cookies no need to call the directory
Sessions are only the persistence of the JWT token in cookies no need to call the directory