Skip to content

Commit

Permalink
updated dependencies and linted a few lines
Browse files Browse the repository at this point in the history
  • Loading branch information
connorbrathwaite committed Apr 16, 2016
1 parent 6c25fce commit bf86cfb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions bin/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ app.keys = [config.session]
mongoose.connect(config.database)

app.use(convert(logger()))
app.use(convert(bodyParser()))
app.use(convert(session()))
app.use(bodyParser())
app.use(session())
app.use(errorMiddleware())

app.use(convert(mount('/docs', serve(`${process.cwd()}/docs`))))
Expand Down
12 changes: 6 additions & 6 deletions config/passport.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import passport from 'koa-passport';
import passport from 'koa-passport'
import User from '../src/models/users'
import { Strategy } from 'passport-local'

Expand All @@ -10,7 +10,7 @@ passport.deserializeUser(async (id, done) => {
try {
const user = await User.findById(id, '-password')
done(null, user)
} catch(err) {
} catch (err) {
done(err)
}
})
Expand All @@ -21,19 +21,19 @@ passport.use('local', new Strategy({
}, async (username, password, done) => {
try {
const user = await User.findOne({ username })
if(!user) { return done(null, false) }
if (!user) { return done(null, false) }

try {
const isMatch = await user.validatePassword(password)

if(!isMatch) { return done(null, false) }
if (!isMatch) { return done(null, false) }

done(null, user)
} catch(err) {
} catch (err) {
done(err)
}

} catch(err) {
} catch (err) {
return done(err)
}
}))
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require("babel-core/register")();
require("babel-polyfill");
require('./bin/server.js');
require('babel-core/register')()
require('babel-polyfill')
require('./bin/server.js')
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"glob": "^7.0.0",
"jsonwebtoken": "^5.5.4",
"koa": "^2.0.0-alpha.3",
"koa-bodyparser": "^2.0.1",
"koa-bodyparser": "^3.0.0",
"koa-convert": "^1.2.0",
"koa-generic-session": "^1.10.1",
"koa-logger": "^1.3.0",
"koa-logger": "^2.0.0",
"koa-mount": "^1.3.0",
"koa-passport": "^2.0.1",
"koa-router": "^7.0.1",
Expand All @@ -52,12 +52,12 @@
},
"devDependencies": {
"apidoc": "^0.15.1",
"babel-eslint": "^4.1.8",
"babel-eslint": "^6.0.2",
"babel-register": "^6.5.1",
"chai": "^3.5.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^5.0.0",
"eslint-plugin-react": "^3.16.1",
"eslint": "^2.8.0",
"eslint-config-airbnb": "^7.0.0",
"eslint-plugin-react": "^4.3.0",
"mocha": "^2.4.5",
"nodemon": "^1.8.1",
"supertest": "^1.2.0"
Expand Down
2 changes: 1 addition & 1 deletion test/users.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Users', () => {
.get('/users')
.set({
Accept: 'application/json',
Authorization: 'Unknown ${token}'
Authorization: `Unknown ${token}`
})
.expect(401, done)
})
Expand Down

0 comments on commit bf86cfb

Please sign in to comment.