mirror of
https://github.com/linnovate/mean.git
synced 2025-12-08 19:56:03 +00:00
* feat: upgrade to Angular 13 * feat: switch to ESLint since TSLint has been deprecated * feat: upgrade outdated Node.js packages and Node version within the Dockerfile
12 lines
241 B
JavaScript
12 lines
241 B
JavaScript
const jwt = require('jsonwebtoken');
|
|
const config = require('../config/config');
|
|
|
|
module.exports = {
|
|
generateToken,
|
|
};
|
|
|
|
function generateToken(user) {
|
|
const payload = JSON.stringify(user);
|
|
return jwt.sign(payload, config.jwtSecret);
|
|
}
|