From 9c5a98a9972446baaba693a24c800427e12da24d Mon Sep 17 00:00:00 2001 From: chiefkarim Date: Wed, 27 Sep 2023 11:35:06 +0100 Subject: [PATCH] aded username to the log in response --- controllers/log-inController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/log-inController.js b/controllers/log-inController.js index cb3719f..9d76da0 100644 --- a/controllers/log-inController.js +++ b/controllers/log-inController.js @@ -55,7 +55,7 @@ exports.logIn_post_api = [ if (!user) { return res.send({title:'Log in',errors:[info]}) } const accessToken = jwt.sign({username:req.body.username}, process.env.ACCESS_TOKEN_SECRET) - res.send({accessToken:accessToken}); + res.send({accessToken:accessToken,username:user.username}); })(req, res, next) } }),