404labfr / 404labfr/laravel-impersonate
[Bug]: Setting auth middleware in the controller stops use with multiple guards
Open
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 235
- PR merge metrics
- No merged PRs in 30d
Description
```php
// src/Controllers/ImpersonateController.php
public function __construct()
{
$this->manager = app()->make(ImpersonateManager::class);
$guard = $this->manager->getDefaultSessionGuard();
$this->middleware('auth:' . $guard)->only('take');
}
```
While it's important to encourage security, this forced middleware in the constructor means that if you're using this package for impersonating anything other than the default guard, it won't work since it'll just redirect to login.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.