Example #1
0
 public function authenticate()
 {
     $this->authorize(true);
     $input = $this->app['request']->input;
     $authenticator = new Authenticator($this->userMapper);
     if ($authenticator->authenticate($input['email'], $input['password'])) {
         return $this->redirect('dashboard');
     } else {
         $this->setFlash('errors', 'Email address and/or password are incorrect.');
         return $this->redirect('login');
     }
 }