Skip to content

Commit

Permalink
Merge pull request #552 from UniversityOfHelsinkiCS/trunk
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
Chamion authored Sep 21, 2018
2 parents bbeaf93 + c0931ee commit ec802f9
Show file tree
Hide file tree
Showing 27 changed files with 1,225 additions and 770 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build/
.env.test.local
.env.production.local

debug.log*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
8 changes: 6 additions & 2 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ let express = require('express')
let app = express()
const jwt = require('jsonwebtoken')
const bodyParser = require('body-parser')
const Raven = require('raven')
const logger = require('./server/utils/logger')

Raven.config(process.env.SENTRY_ADDR).install()

require('dotenv').config()

/**
Expand Down Expand Up @@ -106,10 +111,9 @@ const authenticate = (request, response, next) => {
try {
let decoded = jwt.verify(request.token, process.env.SECRET)
;(request.decoded = decoded), (request.authenticated = { success: true, error: '' })
console.log(' Authenticated: true')
} catch (e) {
request.authenticated = { success: false, error: 'token verification failed' }
console.log(' Authenticated: false')
logger.error(e)
}
}

Expand Down
Loading

0 comments on commit ec802f9

Please sign in to comment.