diff options
| author | Adam Soltys <[email protected]> | 2018-01-29 21:33:38 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2018-01-29 21:33:38 -0800 |
| commit | de4d44a58f6bb49d5762632d2cad96e1dc96c56f (patch) | |
| tree | 366f743d4c8dc05593d4c7f8627a8bac6e33ef9a /app.js | |
| parent | 49ec609f5b4dc0c5577c398ff229d710db902d4d (diff) | |
| download | coinos-server-de4d44a58f6bb49d5762632d2cad96e1dc96c56f.tar.gz coinos-server-de4d44a58f6bb49d5762632d2cad96e1dc96c56f.zip | |
minor
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -39,7 +39,7 @@ const l = console.log let fetchRates (fetchRates = () => { - restClient.tickerGlobalPerSymbol('BTCUSD', (data) => { + restClient.tickerGlobalPerSymbol('BTCCAD', (data) => { app.set('rates', JSON.parse(data)) }) setTimeout(fetchRates, 120000) @@ -50,19 +50,17 @@ const l = console.log }) app.post('/login', (req, res) => { - console.log('logging in') db.User.findOne({ where: { username: req.body.username } }).then((user) => { bcrypt.compare(req.body.password, user.password).then((result) => { - console.log('password was good') if (result) { let payload = { username: user.username } let token = jwt.sign(payload, process.env.SECRET) res.cookie('token', token, { expires: new Date(Date.now() + 9999999) }) - res.json({ token: token }) + res.json({ user, token }) } else { res.status(401).end() } |
