404labfr / 404labfr/laravel-impersonate
Impersonation URL 403s after impersonate
- Langage dominant
- PHP
- Étoiles
- 2.3k
- Forks
- 235
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I'm using latest version of Laravel (5.8) and your package. I've installed using the route macro `Route::impersonate()` and have the following in my User model:
```
/**
* @return bool
*/
public function canImpersonate()
{
// For example
return $this->hasRole('admin');
}
```
`hasRole` is part of the very popular [Spatie Laravel Persmissions package](https://github.com/spatie/laravel-permission).
When logged in as an admin, if I visit the route created by your package I'm taken to: /impersonate/take/3
This page 403s. However, when I then visit / I find I'm logged in as the impersonated user (expected behaviour). It looks like the impersonation is potentially being run before middleware or that something else is going on? The route macro is outside of any groups or middleware.
/impersonate/leave works exactly as expected and redirects me correctly.
Any ideas how I can solve this?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.