Skip to content

multiuser login by their role #559

Discussion options

You must be logged in to vote

Ok. In that case the quick way to do it is modifying AuthController's attemptLogin() method.
Example code:

public function attemptLogin()
{
      // default code goes here ...

     // Is the user being forced to reset their password?
     if ($this->auth->user()->force_pass_reset === true) {
            return redirect()->to(route_to('reset-password') . '?token=' . $this->auth->user()->reset_hash)->withCookies();
     }
    
        // add logic to manage different views
       $authorization = service('authorization');
       if ($authorization->inGroup('admin', $this->auth->id())) {
            $whereToGo = route_to('admin_dashboard');
        } elseif ($authorization->inGroup('reguler…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@AbidMuhammadTaufiq
Comment options

@manageruz
Comment options

@AbidMuhammadTaufiq
Comment options

Answer selected by manageruz
Comment options

You must be logged in to vote
3 replies
@manageruz
Comment options

@AbidMuhammadTaufiq
Comment options

@manageruz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants