[Python] How do I store my CSRF token in my frontend nextjs headers. I store my jwt token in...

Discussão em 'Python' iniciado por Stack, Fevereiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I'm creating a website with flask and nextjs and authenticating with jwt and storing it in cookie. In my main page, I set my CSRFToken in my header in my nextjs (although I created a route in flask that sends CSRFToken and nextjs fetches it). It works on insomnia, but doesn't work on my browser. It keeps giving me a "missing cookie token" error. How do I fix it

    In my nextjs, my headers is const res = await fetch('http: localhost:8080/api', { method: 'GET', headers: { 'X-CSRFTOKEN': fetch('http://localhost:8080/get-csrf-token')} }) I was expecting to fetch json files in /API route

    Continue reading...

Compartilhe esta Página