firecms-ext / auth
hyperf 扩展:用户登录认证
dev-master
2022-10-19 06:49 UTC
Requires
- php: >=8.0
- firecms-ext/hashing: *
- hyperf/db-connection: ~v2.0
- hyperf/di: ~v2.0
- hyperf/framework: ~v2.0
- hyperf/http-message: ~v2.0
- hyperf/http-server: ~v2.0
- hyperf/model-cache: ~v2.0
- hyperf/snowflake: ~v2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: >=7.0
- swoole/ide-helper: ^4.5
Suggests
- swow/swow: Required to create swow components.
This package is auto-updated.
Last update: 2025-02-19 11:38:56 UTC
README
# 登录授权 依赖安装 composer require firecms-ext/auth # 发布配置(配置、数据迁移、用户模型) php bin/hyperf.php vendor:publish firecms-ext/auth # 密码加密 依赖安装 composer require firecms-ext/hashing # 发布配置 php bin/hyperf.php vendor:publish firecms-ext/hashing # JWT 登录扩展 依赖安装 composer require firecms-ext/jwt # 生成(JWT)签名 Token 令牌 私钥和公钥 php bin/hyperf.php gen:jwt-keypair # 生成(JWT)签名 Token 令牌 密钥 php bin/hyperf.php gen:jwt-secret
函数列表
# 认证助手 function auth(?string $guard = null): GuardInterface # 用户登录 function attempt(array $credentials, ?string $guard = null): bool # 用户登录 function login(AuthenticateInterface $user, ?string $guard = null): bool # 注销登录 function logout(): void