feat: auto userdata fetch
fix: gql directives and overall minor fixes
This commit is contained in:
parent
3f6c0e6037
commit
9fa97725ec
22 changed files with 94 additions and 127 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const otplib = require('otplib')
|
||||
const bcrypt = require('bcrypt')
|
||||
const { AuthenticationError } = require('apollo-server-express')
|
||||
|
||||
const loginHelper = require('../../services/login')
|
||||
const T = require('../../../time')
|
||||
|
|
@ -27,7 +28,7 @@ function authenticateUser(username, password) {
|
|||
|
||||
const getUserData = context => {
|
||||
const lidCookie = context.req.cookies && context.req.cookies.lid
|
||||
if (!lidCookie) throw new authErrors.InvalidCredentialsError()
|
||||
if (!lidCookie) throw new AuthenticationError()
|
||||
|
||||
const user = context.req.session.user
|
||||
return user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue