From b1c817617b78196db54610c59b31d19a2a95fbe0 Mon Sep 17 00:00:00 2001 From: Logan Davis Date: Tue, 2 May 2017 16:09:51 -0400 Subject: [PATCH] Hotfix registration to add sane default name --- routes/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/routes/index.js b/routes/index.js index 66cf17a..a0efa81 100644 --- a/routes/index.js +++ b/routes/index.js @@ -42,10 +42,17 @@ router.get('/logout', // register new user with local strategy router.post('/register', (req, res) => { Student.register(new Student({ username: req.body.username }), - req.body.password, (regErr, account) => { + req.body.password, (regErr, newAccount) => { if (regErr) { console.error(regErr); } + // hotfix. Redux demands these fields be filled, + // but they have no default values + const account = Object.assign(newAccount, { + name: 'Test User', + entryYear: '2001', + major: 'Mechanical Engineering', + }); account.save((saveErr) => { if (saveErr) { console.error(saveErr);