auth repository

runphp 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines
database 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines
src 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines
test 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines
.gitignore 361ff44d10 feat(auth): 添加认证模块 il y a 11 mois
LICENSE feed385be4 Initial commit il y a 11 mois
README.md 361ff44d10 feat(auth): 添加认证模块 il y a 11 mois
command.php 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines
composer.json 2b3fece169 chore(deps): 更新 firebase/php-jwt 依赖版本 il y a 4 mois
config.php 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines
info.php 7f3cde8f02 refactor(migration): 统一数据库迁移基类为 Phinx\Migration\AbstractMigration, il y a 2 semaines

README.md

Auth 模块说明

Auth 模块是 SixShop 的权限管理模块,用于管理用户、角色、权限等。

接口

AuthInterface 生成token和验证token

interface AuthInterface
{
    /**
     * 用户ID生成token
     */
    public function generateToken(string $userId): string;

    /**
     * 验证token是否有效,并返回用户ID
     */
    public function verifyToken(string $jwt): string;

    /**
     * 刷新token,返回新的token
     */
    public function refreshToken(string $jwt): string;

    /**
     * 注销token
     */
    public function revokeToken(string $jwt): void;
    
    /**
     * 获取用户类型
     */
    public function getUserType(): UserTypeEnum;
}

HOOKS

  1. token_verify: token验证触发
  2. token_revoke: token注销触发