Skip to content

Instantly share code, notes, and snippets.

@asciant
Created May 3, 2019 05:26
Show Gist options
  • Save asciant/52073710ef82a42242e14c9a711b16ab to your computer and use it in GitHub Desktop.
Save asciant/52073710ef82a42242e14c9a711b16ab to your computer and use it in GitHub Desktop.
Diff.js
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