diff options
author | 2021-08-22 14:33:54 +0200 | |
---|---|---|
committer | 2021-08-29 15:35:49 +0200 | |
commit | 9f74c550927671f4ded301d0cf3e9d592716375c (patch) | |
tree | 6075bead5939bfb9c3b6137fc5ef865f088b57cb /pages/api/login.js | |
parent | 71cc09db93ec9b079a30593e14ca57c98fdc94ac (diff) | |
download | my_apps-9f74c550927671f4ded301d0cf3e9d592716375c.tar.gz my_apps-9f74c550927671f4ded301d0cf3e9d592716375c.tar.bz2 my_apps-9f74c550927671f4ded301d0cf3e9d592716375c.zip |
settings
Diffstat (limited to 'pages/api/login.js')
-rw-r--r-- | pages/api/login.js | 4 |
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) |