diff --git a/.env.example b/.env.example index 228e00d..777ff73 100755 --- a/.env.example +++ b/.env.example @@ -17,7 +17,7 @@ APP_LOCALE=en APP_FALLBACK_LOCALE=en APP_FAKER_LOCALE=en_US -AUTH_GUARD=api +AUTH_GUARD=web APP_MAINTENANCE_DRIVER=file APP_MAINTENANCE_STORE=database @@ -43,6 +43,8 @@ SESSION_LIFETIME=120 SESSION_ENCRYPT=false SESSION_PATH=/ SESSION_DOMAIN=null +SANCTUM_STATEFUL_DOMAINS=localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1 +SESSION_SECURE_COOKIE=false BROADCAST_CONNECTION=log FILESYSTEM_DISK=local diff --git a/README.md b/README.md index e250c70..cdee020 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ The goal of the project is to create a template for development on Laravel and N - [Installation](#installation) - [Standalone](#standalone) - [Docker Deploy (Laravel Sail)](#docker-deploy-laravel-sail) + - [Auth Guard Switch](#auth-guard-switch) - [Upgrade](#upgrade) - [Usage](#usage) - [Fetch wrapper](#fetch-wrapper) @@ -36,7 +37,7 @@ The goal of the project is to create a template for development on Laravel and N - [**Laravel 12**](https://laravel.com/docs/12.x) and [**Nuxt 4**](https://nuxt.com/) - [**Laravel Octane**](https://laravel.com/docs/12.x/octane) supercharges your application's performance by serving your application using high-powered application servers. - [**Laravel Telescope**](https://laravel.com/docs/12.x/telescope) provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more. - - [**Laravel Sanctum**](https://laravel.com/docs/12.x/sanctum) Token-based authorization is compatible with **SSR** and **CSR** + - [**Laravel Sanctum**](https://laravel.com/docs/12.x/sanctum) Token/Session-based authorization is compatible with **SSR** and **CSR** - [**Laravel Socialite**](https://laravel.com/docs/12.x/socialite) OAuth providers - [**Laravel Sail**](https://laravel.com/docs/12.x/sail) Light-weight command-line interface for interacting with Laravel's default Docker development environment. - [**Spatie Laravel Permissions**](https://spatie.be/docs/laravel-permission/v6/introduction) This package allows you to manage user permissions and roles in a database. @@ -89,6 +90,14 @@ To make sure this is always available, you may add this to your shell configurat > Read the full [Laravel Sail](https://laravel.com/docs/12.x/sail) documentation to get the best user experience +### Auth Guard Switch + +You can switch the authentication guard between **Token** and **Session** using the following command: + +```shell +php artisan auth:switch +``` + ## Upgrade Standalone: @@ -117,7 +126,6 @@ Additionally, `$http` predefines a base url, authorization headers, and proxy IP For example, the code for authorizing a user by email and password: ```vue