tuanha / auth-api-gateway
A package login with service auth
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tuanha/auth-api-gateway
Requires
- php: ^7.2
- predis/predis: ^1.1
README
Sau khi tải package về. Cần thực hiện các bước sau để có thể sử dụng:
Cấu hình file env cho trùng với server Redis của Server Auth
VD:
-
BROADCAST_DRIVER=log -
CACHE_DRIVER=file -
QUEUE_CONNECTION=sync -
SESSION_DRIVER=redis -
SESSION_LIFETIME=1200 -
CACHE_PREFIX=LONGND -
REDIS_CLIENT=predis -
REDIS_HOST=127.0.0.1 -
REDIS_PASSWORD=null -
REDIS_PORT=6379
Sửa các file config cho phù hợp:
- Thêm vào providers trong file app.php :
ViralMS\AuthApiGateway\AuthApiGatewayServiceProvider::class, - Ẩn dòng trong file database:
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
Chạy publish vendor:
- chạy command:
php artisan vendor:publish --provider=ViralMS\AuthApiGateway\AuthApiGatewayServiceProvider
Thay thế middleware Auth trong file Kernel.php ở biến $routeMiddleware:
'auth' => \ViralMS\AuthApiGateway\AuthenticateRedis::class,'guest' => \ViralMS\AuthApiGateway\RedirectIfAuthenticatedRedis::class,