aboutsummaryrefslogtreecommitdiffstats
path: root/pages/api/login.js
diff options
context:
space:
mode:
Diffstat (limited to 'pages/api/login.js')
-rw-r--r--pages/api/login.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/pages/api/login.js b/pages/api/login.js
index 30edda1..db39bda 100644
--- a/pages/api/login.js
+++ b/pages/api/login.js
@@ -10,10 +10,10 @@ export default withSession(async (req, res) => {
switch (method) {
case 'POST':
try {
- const {_id, email, isVerified, noteList} = await User.findByCredentials(req.body.email, req.body.password);
+ const {_id, email, isVerified, noteList, theme, language} = await User.findByCredentials(req.body.email, req.body.password);
if (!email) { throw new Error('Something went wrong') }
- const user = {_id, email, isVerified, isLoggedIn: true, noteList}
+ const user = {_id, email, isVerified, isLoggedIn: true, noteList, theme, language}
req.session.set('user', user)
await req.session.save()
res.status(201).json(user)