shahriarsajeeb / Eshop-tutorial

https://eshop-tutorial.vercel.app
809 stars 278 forks source link

Gmail Activation Link getting expried after 1sec #7

Open Nithishkumarr opened 1 year ago

Nithishkumarr commented 1 year ago

Gmail Activation Link getting expried after 1sec

I Downloaded [https://github.com/shahriarsajeeb/Eshop-tutorial/tree/4ce1ebd71ed57b8a25d7bddcc227f447d684d1e7 ] st commit add add my mongoURl ,SMPT_MAIL,SMPT_PASSWORD and run the front end and backend there is no error in console in localhost:3000/sign-up url after filling form Iam getting activation token in provided mail and when i click that I got Your account has been created suceessfully! and after 1 sec it changes to Your token is expired! and got internal sever error status code 500 I have attached Screen shot of that so please help @shahriarsajeeb

error500


bhupenjp commented 1 year ago

i have a same problem.plz help us.

Nithishkumarr commented 1 year ago

i have a same problem.plz help us.

ya I same here I clone the 1st commit then also getting same error

AdelakunShola commented 1 year ago

Were you able to fix it, i have same issue.

Jerald13 commented 6 months ago

I fixed. My issues was the model folder user.js did not implement

const jwt = require("jsonwebtoken")  

// jwt token
userSchema.methods.getJwtToken = function () {
  return jwt.sign({ id: this._id }, process.env.JWT_SECRET_KEY, {
    expiresIn: process.env.JWT_EXPIRES,
  })
}
Somto-ob commented 3 months ago

I fixed. My issues was the model folder user.js did not implement

const jwt = require("jsonwebtoken")  

// jwt token
userSchema.methods.getJwtToken = function () {
  return jwt.sign({ id: this._id }, process.env.JWT_SECRET_KEY, {
    expiresIn: process.env.JWT_EXPIRES,
  })
}

How did you fix it. My code looks the same as yours but I am still having the issue