change guard
This commit is contained in:
parent
f7e84885bc
commit
5172b975b5
|
@ -37,7 +37,7 @@ class Authenticate
|
||||||
* @param string|null $guard
|
* @param string|null $guard
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next, $guard = null)
|
public function handle($request, Closure $next, $guard = 'auth')
|
||||||
{
|
{
|
||||||
//oauth 回调
|
//oauth 回调
|
||||||
$code = $request->input('pd_code');
|
$code = $request->input('pd_code');
|
||||||
|
|
|
@ -22,7 +22,7 @@ class PdAuthServiceProvider extends ServiceProvider
|
||||||
// should return either a User instance or null. You're free to obtain
|
// should return either a User instance or null. You're free to obtain
|
||||||
// the User instance via an API token or any other method necessary.
|
// the User instance via an API token or any other method necessary.
|
||||||
|
|
||||||
$this->app['auth']->viaRequest('api', function (Request $request) {
|
$this->app['auth']->viaRequest('auth', function (Request $request) {
|
||||||
|
|
||||||
$token = $request->cookie(Authenticate::CookieName);
|
$token = $request->cookie(Authenticate::CookieName);
|
||||||
|
|
||||||
|
@ -38,6 +38,13 @@ class PdAuthServiceProvider extends ServiceProvider
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
//
|
||||||
|
$config = $this->app['config']['auth'];
|
||||||
|
|
||||||
|
if (!isset($config['guards']['auth'])) {
|
||||||
|
config(['auth.guards.auth' => ['driver' => 'auth']]);
|
||||||
|
config(['auth.defaults.guard' => 'auth']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupConfig()
|
protected function setupConfig()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user