Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Trouble using two auth driver on the same site
  • Hello, I have a little problem when using two different auth driver (that's i have done, who are very small modification of simpleauth one). There's 2 private area on my site, and i can log in an area flawless, but when i want to go to the other part, i can never log. No error, no check, it's like auth check is always true, but in fact failed. If i logout, i can then log in on the other area, no problem. So i tried to logout using this :
     if (Input::method() == 'POST') {
                $val->add('email', 'Email')
                        ->add_rule('required');
                $val->add('password', 'Mot de passe')
                        ->add_rule('required');
    
                    $auth_Pro = Auth::instance('InstanceOne');
                    $auth_Pro->logout();
    
                if ($val->run()) {
                    $auth = Auth::instance('InstanceTwo')
                       if (Auth::check('InstanceTwo') or $auth->login(Input::post('email'), Input::post('password'))) {
    ....
    
    I must reload page for this code, in order to work. Is there a way to make this works without reloading the page, to make it transparent for the user ? Thanks for your help
  • Sounds like your modifications were to small. Make sure the drivers use unique session data, so that a login for one driver isn't detected as a login for the other.
  • I already don't use the same variable name for the session stuff (different username and login_hash variable name) . Is there something that i should have forgot ?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion