File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments