'XSRF-TOKEN not generating in laravel api with next.js app

XSRF-TOKEN not generating in laravel API with next.js app in live server. but everything is working fine on localhost. I am using Laravel as the backend and next.js as the frontend.

Localhost Image

enter image description here



Solution 1:[1]

I think you forgot to generate APP_KEY on your production environment, check .env file and in case APP_KEY is empty try to call php artisan key:generate command.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 eldorjon