Prisma1: Auth context is always null

Created on 12 Oct 2017  路  2Comments  路  Source: prisma/prisma1

What is the current behavior?

When I try to run the loggedInUser query from the authentication example, event.context.auth is always null.

Steps to reproduce

  1. Clone/download the auth example
  2. Deploy with graphcool deploy
  3. Execute signupEmailUser mutation in Playground
  4. Copy returned token
  5. Prepare loggedInUser query in Playground
  6. Add HTTP header in Playground: Authorization: <copied token>
  7. Execute query

Query result:

{
  "data": {
    "loggedInUser": {
      "id": null
    }
  }
}

The loggedInUser function logs "No auth context". I've added an additional log message to print out the whole context object. event.context.auth is indeed null.

What is the expected behavior?

event.context.auth should contain any authentication data.

Most helpful comment

In step 6, you need to set Authorization: Bearer <token>, are you doing this?

All 2 comments

In step 6, you need to set Authorization: Bearer <token>, are you doing this?

I'm pretty sure I've tried it with and without Bearer. But it seems to work now 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marktani picture marktani  路  3Comments

akoenig picture akoenig  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments

schickling picture schickling  路  3Comments

schickling picture schickling  路  3Comments