404labfr / 404labfr/laravel-impersonate

Impersonation URL 403s after impersonate

Đang mở
#72 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
help wanted
Ngôn ngữ chính
PHP
Star
2.3k
Fork
235
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.