Answer the question
In order to leave comments, you need to log in
Node error: {function} is not a function?
This function is defined in the generateJWTAccessToken file :
const jwt = require('jsonwebtoken');
module.exports = function generateJWTAccessToken(data, time = '6h', algo = 'HS256', secret){
return jwt.sign({data,}, secret, {expiresIn:time , algorithm:algo});
}
const {generateJWTAccessToken} = require('../tokensJwt/generateJwtToken');
const jwtAccessToken = generateJWTAccessToken(user.email, "7h", "HS256", secret.secretWordJwtAccess);
res.status(200).json({message:`welcome back ${req.body.login}, ${jwtAccessToken}`});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question