Laravel 12 JWT authentication service for the Danendz platform. Issues tokens that are shared across all services via a common JWT_SECRET. Deployed on Railway.com at https://api.danendz.com/api/auth/.
| Language | PHP ^8.4 |
| Framework | Laravel 12 |
| Database | PostgreSQL |
| Auth | JWT (php-open-source-saver/jwt-auth) |
| Testing | Pest |
| Method | Endpoint | Auth required | Description |
|---|---|---|---|
POST |
/auth/register |
No | Register a new user |
POST |
/auth/login |
No | Login, returns access + refresh tokens |
GET |
/auth/me |
Yes | Get current user info |
POST |
/auth/logout |
Yes | Invalidate current token |
POST |
/auth/refresh |
No | Refresh access token |
All responses are JSON. Protected endpoints require Authorization: Bearer <token>.
# Install dependencies, run migrations, build assets
composer setup
# Start dev server
composer devOr with Sail (Docker):
./vendor/bin/sail up -d
./vendor/bin/sail artisan migratecomposer test
# Or with Sail
./vendor/bin/sail testAPP_PORT=8082
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=auth
DB_USERNAME=sail
DB_PASSWORD=password
JWT_SECRET= # shared with all other services
JWT_TTL=60 # access token TTL in minutes
JWT_REFRESH_TTL= # refresh token TTL in minutesDeployed on Railway.com. Base URL: https://api.danendz.com/api/auth/
The JWT_SECRET must be identical across all services (Auth, Marquer Backend, etc.) for cross-service token validation to work.