Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse a Graphcool token #2

Open
marktani opened this issue Jul 6, 2017 · 1 comment
Open

Parse a Graphcool token #2

marktani opened this issue Jul 6, 2017 · 1 comment

Comments

@marktani
Copy link
Contributor

marktani commented Jul 6, 2017

The generateAuthToken method is great for creating a token given a node id, typename and payload; the reverse method parseAuthToken would be helpful in many use cases as well, for example to automatically connect a created post to the user that made the request.

@kbrandwijk
Copy link

kbrandwijk commented Jul 23, 2017

I now use:

const { projectId, nodeId: userId, modelName } = require('jsonwebtoken').decode(token)

Which is helpful, but not as helpful as a System API mutation that does this, and actually verifies the token, instead of just decoding it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants