aboutsummaryrefslogtreecommitdiffstats
path: root/pages/api/register.js
diff options
context:
space:
mode:
authorGravatar piotrruss <mail@pruss.it> 2021-08-22 14:33:54 +0200
committerGravatar piotrruss <mail@pruss.it> 2021-08-29 15:35:49 +0200
commit9f74c550927671f4ded301d0cf3e9d592716375c (patch)
tree6075bead5939bfb9c3b6137fc5ef865f088b57cb /pages/api/register.js
parent71cc09db93ec9b079a30593e14ca57c98fdc94ac (diff)
downloadmy_apps-9f74c550927671f4ded301d0cf3e9d592716375c.tar.gz
my_apps-9f74c550927671f4ded301d0cf3e9d592716375c.tar.bz2
my_apps-9f74c550927671f4ded301d0cf3e9d592716375c.zip
settings
Diffstat (limited to 'pages/api/register.js')
-rw-r--r--pages/api/register.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/pages/api/register.js b/pages/api/register.js
index f89e347..1407146 100644
--- a/pages/api/register.js
+++ b/pages/api/register.js
@@ -13,12 +13,12 @@ export default withSession(async (req, res) => {
try {
const noteList = await NoteList.create({})
- const {_id, email, verificationKey: key} = await User.create({...req.body, noteList})
+ const {_id, email, verificationKey: key, theme, language} = await User.create({...req.body, noteList})
if (!email) { throw new Error('Something went wrong') }
sendMail(req.body.email, subject, text(key), html(key))
- const user = {_id, email, noteList, isVerified: false, isLoggedIn: true}
+ const user = {_id, email, noteList, theme, language, isVerified: false, isLoggedIn: true}
req.session.set('user', user)
await req.session.save()
res.status(201).json(user)