Cookies Psst! Do you accept cookies?

We use cookies to enhance and personalise your experience.
Please accept our cookies. Checkout our Cookie Policy for more information.

Cannot read property 'jwtoken' of undefined

Cannot read property 'jwtoken' of undefined

Oct 14 '21 Comments: 1 Answers: 0 0

here I generate the token at backend in express .............."/login",async(req,res)=>{
    const {email,password}=req.body;
    if(!email || !password){
        return res.status(401).send({error:"please filled the data properly"});
    try {
        const loginUser=await User.findOne({email:email});
            return res.status(400).send({error:"not found"});
        const isMatch = await,loginUser.password);    
            const token=await loginUser.generateToken();
                expires:new Date(,
                //secure:true  //it
Open Full Question

Related Stories

What's your thoughts?

Please Register or Login to your account to be able to submit your comment.