TransWikia.com

Laravel GraphQL and Sanctum - how to combine it?

Stack Overflow Asked by kamilon123s on December 13, 2020

I’m not sure how I can connect GraphQL (Lighthouse) to Laravel Sanctum. I have read the documentation thoroughly, but I am not completely satisfied. Many things are unclear to me.

Documencation: https://lighthouse-php.com/master/security/authentication.html#attemptauthentication-middleware

How is it with csrf protection? In addition to GraphQL queries – do you also need to query axios first?

axios.get('/sanctum/csrf-cookie').then(response => {
    // Login...
});

I would be very grateful if someone showed me a detailed example of how to handle login. I will add that my frontend is based on Nuxt.js (VueJS).

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP