11 lines
231 B
JavaScript
11 lines
231 B
JavaScript
//--------TOKEN GENERATOR---------------//
|
|
const jwt=require('jsonwebtoken');
|
|
|
|
const tokenGenerator=(username)=>
|
|
{
|
|
const token=jwt.sign({username},process.env.JWT_KEY);
|
|
return token;
|
|
}
|
|
|
|
module.exports.tokenGenerator=tokenGenerator
|