Created
May 3, 2019 05:26
-
-
Save asciant/52073710ef82a42242e14c9a711b16ab to your computer and use it in GitHub Desktop.
Diff.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.express.use(async (request, response, next) => { | |
if (!request.userId) return next(); | |
const user = await db.query.user( | |
{ where: { id: request.userId } }, | |
'{ id, permission, email, name }' | |
); | |
request.user = user; | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment