From 9f74c550927671f4ded301d0cf3e9d592716375c Mon Sep 17 00:00:00 2001 From: piotrruss Date: Sun, 22 Aug 2021 14:33:54 +0200 Subject: settings --- pages/api/login.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pages/api/login.js') 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) -- cgit v1.2.3