#I am having trouble making API requests in Next using Server Components with the breeze-next starter

2 messages · Page 1 of 1 (latest)

strange summit
#

I want to make requests to my Laravel API from a server component, but it always returns a 401. When I use ‘use client’ the request is made without problems, I suppose it’s an issue with how CSRF tokens are sent from my SC. Is it possible to make this type of request from an SC?

slender fable
#

I think you need different middleware for server-side validation. CSRF is for client side and SSRF for server side. My suggestion is ignore csrf token for your server IP.