The req.logout() function requires a callback function that is executed after the logout process is complete