Standard\Controllers\AuthController::processLoginAction PHP Method

processLoginAction() public method

public processLoginAction ( )
    public function processLoginAction()
    {
        $success = false;
        try {
            $success = Gatekeeper::authenticate(['username' => $_POST['email'], 'password' => $_POST['password']]);
        } catch (\Exception $e) {
            $this->flasher->error($this->site['debug'] ? $e->getMessage() : 'Something went wrong');
            $this->redirect('/auth');
        }
        if ($success) {
            $_SESSION['user'] = $_POST['email'];
            $this->redirect('/');
        } else {
            $this->flasher->error('Invalid credentials!');
            $this->redirect('/auth');
        }
    }