Vinnie
11/13/2017, 12:19 PMVinnie
11/13/2017, 2:23 PMVinnie
11/13/2017, 3:25 PMagartha
11/13/2017, 3:28 PMcreateUser
mutation. It has full permissions to run any query or mutation because of that, regardless of you permission settings.Vinnie
11/13/2017, 3:29 PMconst token = await graphcool.generateNodeToken(userId, ‘User’)
Vinnie
11/13/2017, 3:32 PMagartha
11/13/2017, 3:32 PMagartha
11/13/2017, 3:33 PMVinnie
11/13/2017, 3:33 PMVinnie
11/13/2017, 3:33 PMVinnie
11/13/2017, 3:33 PMVinnie
11/13/2017, 3:37 PMagartha
11/13/2017, 3:39 PMtoken
from context.auth
instead of the rootToken
to call the mutation.Vinnie
11/13/2017, 3:44 PMVinnie
11/13/2017, 3:45 PMagartha
11/13/2017, 3:45 PMVinnie
11/13/2017, 4:59 PMagartha
11/13/2017, 5:01 PMagartha
11/13/2017, 5:02 PMfromEvent(event)
Vinnie
11/13/2017, 5:02 PMVinnie
11/13/2017, 5:02 PMagartha
11/13/2017, 5:03 PMVinnie
11/13/2017, 5:03 PMagartha
11/13/2017, 5:05 PMfromEvent(event, { token: event.context.auth.token })
it should use the user token instead of the rootTokenVinnie
11/13/2017, 5:05 PMagartha
11/13/2017, 5:05 PMevent.context.auth
will be null
when the mutation is called without a Authorization headeragartha
11/13/2017, 5:06 PMreturn { error: "..." }
Vinnie
11/13/2017, 5:09 PM