File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ exports.signin = async (req, res) => {
6565 // Generating token using user email
6666 const token = jsonWebToken . sign ( { email : email } , process . env . SECRET ) ;
6767 // Setting cookie with the token that will expire after one day
68- res . cookie ( "token_id " , token , { expire : new Date ( ) + 1 } ) ;
68+ res . cookie ( "token " , token , { expire : new Date ( ) + 1 } ) ;
6969
7070 return res . status ( 202 ) . json ( { _id : _id , name : name , email : email , bio : bio } ) ;
7171 }
@@ -85,6 +85,6 @@ exports.isSignedin = expressjwt({
8585// Signout user
8686exports . signout = async ( req , res ) => {
8787 // Clearing cookie
88- res . clearCookie ( "token_id " ) ;
88+ res . clearCookie ( "token " ) ;
8989 return res . status ( 205 ) . json ( { message : "User signed out" } ) ;
9090}
You can’t perform that action at this time.
0 commit comments