feat: login + TFA authentication

This commit is contained in:
NGPixel
2018-01-09 20:41:53 -05:00
parent 85717bd369
commit cb0d86906f
14 changed files with 402 additions and 44 deletions

View File

@@ -114,7 +114,17 @@ module.exports = async () => {
app.use('/', ctrl.auth)
app.use('/graphql', graphqlApollo.graphqlExpress({ schema: graphqlSchema }))
app.use('/graphql', (req, res, next) => {
graphqlApollo.graphqlExpress({
schema: graphqlSchema,
context: { req, res },
formatError: (err) => {
return {
message: err.message
}
}
})(req, res, next)
})
app.use('/graphiql', graphqlApollo.graphiqlExpress({ endpointURL: '/graphql' }))
// app.use('/uploads', mw.auth, ctrl.uploads)
app.use('/admin', mw.auth, ctrl.admin)