tuanha/auth-api-gateway

There is no license information available for the latest version (1.1.5) of this package.

A package login with service auth

1.1.5 2019-12-25 02:13 UTC

This package is auto-updated.

Last update: 2024-09-25 20:17:30 UTC


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,