From 8da3ce1de25f0524bb96b667a1c6f11eb25494d6 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Sat, 27 Jul 2024 21:56:22 +0530 Subject: fixed jwt error --- backend/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3-59-g8ed1b