jsadways/authenticator

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

Installs: 392

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/jsadways/authenticator

1.0.25 2026-01-05 03:20 UTC

README

JsAuthenticate 是 Laravel 框架套件,用於使用者認證管理。

功能

  • 登入 API
  • 使用者 Middleware 驗證

安裝

  1. 下載套裝
composer require jsadways/authenticator
  1. 將套件可設定配置複製到專案
php artisan vendor:publish --provider="Js\Authenticator\Providers\AuthServiceProvider"
  1. 在專案 .env 添加帳號驗證網址與前端網址
JS_AUTH_HOST='http://authenticate.tw'
FORESTAGE_URL='http://172.16.1.156:3100/struct'

使用

  • 套件有提供 Middleware 驗證功能,名稱為 js-authenticate-middleware-alias,在進行驗證成功之後會在請求加入 user_id。
// 在需驗證位置加入 js-authenticate-middleware-alias 中間件
Route::middleware(['js-authenticate-middleware-alias'])->group(function () {
    // 路徑
});