mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-24 21:39:36 +02:00
Added login route and token signing
This commit is contained in:
parent
ea57dbf750
commit
5805c708d2
8 changed files with 153 additions and 1 deletions
8
utils/signToken.js
Normal file
8
utils/signToken.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
const jwt = require('jsonwebtoken');
|
||||
|
||||
const signToken = (expiresIn) => {
|
||||
const token = jwt.sign({ app: 'flame' }, process.env.SECRET, { expiresIn });
|
||||
return token;
|
||||
};
|
||||
|
||||
module.exports = signToken;
|
Loading…
Add table
Add a link
Reference in a new issue