404labfr / 404labfr/laravel-impersonate

Impersonation URL 403s after impersonate

オープン
#72 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
help wanted
主要言語
PHP
スター
2.3k
フォーク
235
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。