joselfonseca / lighthouse-graphql-passport-auth

Add GraphQL mutations to get tokens from passport for https://lighthouse-php.com/
https://lighthouse-php-auth.com/
MIT License
228 stars 56 forks source link

How to do CSRF Token Validation? #153

Closed NoumanAhmad-Braqsol closed 2 years ago

NoumanAhmad-Braqsol commented 2 years ago

As i have read the documentation here is nothing explain abut CSRF token. How we implement CSRF token verification in lighthouse-graphql-passport-auth

joselfonseca commented 2 years ago

Hello @NoumanAhmad-Braqsol thanks for the question.

It depends how you want to use it, it feels a little out of scope for the package but you could add the middleware to lighthouse middleware stack and then validate it in every request.

https://lighthouse-php.com/5/security/csrf.html here is the documentation on lighthouse about that.