Skip to content

Commit de2df70

Browse files
committed
check modified logout functionality
1 parent 10f4008 commit de2df70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routes/users.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ userRouter.delete("/delete", ensureIsUser, async (req, res, next) => {
102102
throw new ExpressError("Unable to delete target user account", 404);
103103
}
104104

105-
res.clearCookie('sid');
106-
res.clearCookie('_sid');
105+
res.clearCookie('sid', {domain: 'twesche.com'});
106+
res.clearCookie('_sid', {domain: 'twesche.com'});
107107
return res.json({message: "Your account has been deleted."})
108108
} catch (error) {
109109
return next(error);
@@ -119,8 +119,8 @@ userRouter.delete("/delete", ensureIsUser, async (req, res, next) => {
119119

120120
userRouter.get("/logout", async (req, res, next) => {
121121
try {
122-
res.clearCookie('sid');
123-
res.clearCookie('_sid');
122+
res.clearCookie('sid', {domain: 'twesche.com'});
123+
res.clearCookie('_sid', {domain: 'twesche.com'});
124124

125125
return res.json({"message": "Logout successful."})
126126
} catch (error) {

0 commit comments

Comments
 (0)