Fixing signup
This commit is contained in:
parent
c554e1750e
commit
e0f7740bc3
@ -13,7 +13,7 @@ router.post('/signup', async (req, res) => {
|
||||
if(users.length == 0) {
|
||||
let user = new User(email, password);
|
||||
await collection.insertOne(user.toDB());
|
||||
user.token = jwt.sign({ email }, '#IWantToBelieve', { expiresIn: '365d' });
|
||||
user.token = jwt.sign({ email }, process.env.JWT_SECRET_AUTH, { expiresIn: process.env.JWT_EXPIRATION_TIME });
|
||||
res.send({ success: true, data: user });
|
||||
} else {
|
||||
res.send(makeError('User already exists'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user