aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-27 21:56:22 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-27 21:56:22 +0530
commit8da3ce1de25f0524bb96b667a1c6f11eb25494d6 (patch)
treed358f672fd59b59b2afc067d80148361923637f2 /backend
parentffb65bdfa58ac862e417a8271c2ec3552c9c4135 (diff)
downloadadmin-panel-8da3ce1de25f0524bb96b667a1c6f11eb25494d6.tar.gz
admin-panel-8da3ce1de25f0524bb96b667a1c6f11eb25494d6.tar.bz2
admin-panel-8da3ce1de25f0524bb96b667a1c6f11eb25494d6.zip
fixed jwt error
Diffstat (limited to 'backend')
-rw-r--r--backend/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/index.js b/backend/index.js
index 9693dcd..f70153a 100644
--- a/backend/index.js
+++ b/backend/index.js
@@ -85,7 +85,7 @@ app.post('/login', async (req, res) => {
return res.status(400).send('Invalid username or password');
}
- const token = jwt.sign({ username: user.username }, JWT_SECRET, { expiresIn: '1h' });
+ const token = jwt.sign({ username: user.username }, process.env.JWT_SECRET, { expiresIn: '1h' });
res.json({ token });
} catch (error) {
console.error('Error during login:', error);