404labfr / laravel-impersonate

Laravel Impersonate is a plugin that allows you to authenticate as your users.
https://marceau.casals.fr
1.95k stars 203 forks source link

Impersonate accross sub-domain + multi type of user #161

Closed simsar78 closed 1 year ago

simsar78 commented 2 years ago

Hello, i have a laravel project with multi sub-domain and multi type of user.

Example: the major complex state is:

i'm on admin.example.it and i need go to customer.example.it

i need to impersonate a admin user of customer in customer.example.it

in my controller ->

  if( $customer != null ){
        Auth::user()->impersonate($customer);
    }

    return redirect()->route('go_to_customer', ['subdomain' => $subdomain]);

When i go to customer.example.it it's impossible ti'm not logged on it because the impersonate not work on another sub-domain but it's have successfully impersonate on started subdomain (admin.example.it)

Another step ... if first impersonate is ok i need to sub-impersonate from admin user of customer.example.it to another type of user of customer.example.it

It's possible this ?

Thanks

MarceauKa commented 1 year ago

@simsar78 Not possible. The goal of this package is to be simple. But feel free to make a PR