();
          window.location.href = data.authorization_url;
        } catch (error) {
          console.error("SSO initiation failed:", error);
          showError(
            "SSO authentication failed. Please try again or use email/password.",
          );
        }
      }

      // Handle error messages from URL parameters
      function handleErrorMessages() {
        const urlParams = new URLSearchParams(window.location.search);
        const error = urlParams.get("error");

        if (error) {
   