404labfr / 404labfr/laravel-impersonate

Impersonate doesn't work because don't open a user session

Open
#73 1 comment 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
PHP
Stars
2.3k
Forks
235
PR merge metrics
No merged PRs in 30d

Description

Hi,
i'm using impersonate 1.2 on my laravel 5.6 installation.
I'm going to admin area and on every user i've put a button "login as user" and i call impersonate function on my HomeController :
```
public function impersonate($user_id){
if ($user_id!= ''){
$user = User::find($user_id);
Auth::user()->impersonate($user);
return redirect()->route('myPlan.history');
}
return redirect()->back();
}
```

but when i click on that i cannot open route myPlan.history impersonated as other user. But if i login with another simple user and then go back to admin area and click again on "login as user" every works fine, so i think that function doesn't create a user session.
How can i fix?
Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.