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);
    }