Skip to content

Commit

Permalink
fix: logout
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Nov 4, 2022
1 parent 8740987 commit a6c6a08
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/medusa-plugin-auth/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ function getLogoutRouter(configModule: ConfigModule): Router {
const router = Router()

const logoutHandler = async (req, res) => {
try {
if (req.session) {
req.session.destroy()
} catch (e) {
req.session.jwt = {}
}

req.session.jwt = {}

res.clearCookie(AUTH_TOKEN_COOKIE_NAME);

res.status(200).json({})
Expand Down

0 comments on commit a6c6a08

Please sign in to comment.