auth/auth-router.js
// Creating func to generate a token
Creating func to generate a token
Creating func to generate a token
function generateToken(user) {
  const payload = {
    id: user.id,
    username: user.username
  };
  const options = {
    expiresIn: '24h'
  };
  return jwt.sign(payload, jwtSecret, options);
}
function generateToken ( user ) { const payload = { id : user . id , username : user . username } ; const options = { expiresIn : '24h' } ; return jwt . sign ( payload , jwtSecret , options ) ; }
Creating func to generate a token
Creating func to generate a token