Project Setup & Development Environment Requirements
This project uses Laravel Sanctum with session-based authentication.
Unlike token-based authentication, this approach relies on browser cookies and CSRF protection, which are highly sensitive to domains, browser policies, and request origins.
1. Local Domain Configuration
To enable proper cookie handling, localhost must not be used.
Instead, map a local domain to your machine by adding the following entry to your hosts file:
127.0.0.1 test.youlearnt.co
2. Accessing the Frontend Application
Start the Nuxt development server:
npm run dev
The application must be accessed using the following URL:
http://test.youlearnt.co:3000
[!IMPORTANT] Accessing via
http://localhost:3000will cause authentication failures because cookies issued fortest.youlearnt.coare not shared withlocalhost.
3. Browser Compatibility
We recommend using Firefox for local development.
Other browsers (like Chrome/Edge) may fail during login due to stricter enforcement of CSRF and cookie policies on non-HTTPS local domains, resulting in CSRF token mismatch.