Payload error in jsonwebtoken

后端 未结 7 2199
谎友^
谎友^ 2021-02-01 16:50

I am making a web application using nodejs and angular cli I\'m using JWT to authenticate my login function . But when I process it threw this error

Err

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-01 17:27

    if it's not comming from moongose then use spread operator

    const token = jwt.sign({ ...payload }, config.secret, {
      expiresIn: 100080
    });
    

提交回复
热议问题