Skip to content

Commit 4d6d932

Browse files
author
qbhy
committed
doc: 更新文档
1 parent 7dffc61 commit 4d6d932

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class IndexController extends AbstractController
161161
/** @var User $user */
162162
$user = User::query()->firstOrCreate(['name' => 'test', 'avatar' => 'avatar']);
163163
return [
164-
'token' => $this->auth->guard('sso')->login($user, 'pc'), // sso 方法支持第二个参数,传定义好的客户端
164+
'token' => $this->auth->guard('sso')->login($user, [], 'pc'), // sso 方法支持第二个参数,传定义好的客户端
165165
];
166166
}
167167

@@ -266,6 +266,7 @@ $jwtGuard->user('your token or null'); // jwt 驱动支持手动传入 token,
266266
$jwtGuard->check('your token or null');
267267
$jwtGuard->guest('your token or null');
268268
$jwtGuard->refresh('your token or null'); // 该方法返回新的 token 或者 null
269+
$jwtGuard->login($user, ['sub' => 'qbhy0715','iss' => 'hyperf-auth',]); // 自定义payload
269270

270271
$auth->guard()->login($user); // guard 方法不传参数或者传null都将使用默认值
271272

0 commit comments

Comments
 (0)