diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-02-08 10:41:16 -0500 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-02-08 10:41:16 -0500 |
| commit | 19c9683e2126c68cb9d231293162c756d69c51fb (patch) | |
| tree | 4679ca2dee47740aa0bf6fe623513c4242e027e6 /backend/src/resolvers/Query.js | |
| parent | eabff7cd396d1f37ceb929e666f082ce57f07919 (diff) | |
WIP
Diffstat (limited to 'backend/src/resolvers/Query.js')
| -rw-r--r-- | backend/src/resolvers/Query.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/src/resolvers/Query.js b/backend/src/resolvers/Query.js index a2eb749..e6ea299 100644 --- a/backend/src/resolvers/Query.js +++ b/backend/src/resolvers/Query.js @@ -1,4 +1,4 @@ -const { getUserId, Context } = require('../utils'); +const { getUserId, Context, checkForUserId } = require('../utils'); const { forwardTo } = require('prisma-binding'); const Query = { @@ -31,6 +31,11 @@ const Query = { }, me(parent, args, ctx, info) { + const Authorization = ctx.request.get('Authorization'); + if (!Authorization || Authorization === 'null') { + console.log('Authorization is null'); + return null; + } const id = getUserId(ctx); return ctx.db.query.user({ where: { id } }, info); }, |
