public function login($username, $password, $data)
    {
        // Verify the password against the stored hash
        if (!password_verify($password, $this->getStoredPassword($username))) {
            throw new \Exception('Incorrect username or password', 401);
        }

        // Create token
        return $this->app->tokens->create($data);
    }
public function login($username, $password, $data)
    {
        // Verify the password against the stored hash
        if (!password_verify($password, $this->getStoredPassword($username))) {
            throw new \Exception('Incorrect username or password', 401);
        }

        // Create token
        return $this->app->tokens->create($data);
    }
public function login ( $ username , $ password , $ data ) { // Verify the password against the stored hash if ( ! password_verify ( $ password , $ this -> getStoredPassword ( $ username ) ) ) { throw new \ Exception ( 'Incorrect username or password' , 401 ) ; } // Create token return $ this -> app -> tokens -> create ( $ data ) ; }
Attempts to start a session

@param string $username Username to login
@param string $password Password
@param array $data Data to store in the session
@return array|bool Session data or false
Attempts to start a session