Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/yohangr3/landingpageGTCLoud/llms.txt

Use this file to discover all available pages before exploring further.

GTCloud uses the Firebase Authentication modular SDK v10.14.1 as its sole access-control layer. Every protected page imports from a single source-of-truth module — auth.js — which initializes Firebase once, exposes an auth instance, and re-exports the key SDK functions alongside three custom helpers. No page-level Firebase boilerplate is needed; adding one import and one function call is enough to lock down any route.

Firebase Project Configuration

The platform connects to the following Firebase project:
PropertyValue
projectIdai-agents-gtcloud
authDomainai-agents-gtcloud.firebaseapp.com
storageBucketai-agents-gtcloud.firebasestorage.app
messagingSenderId434277005102
SDK version10.14.1 (modular / tree-shakeable)
The Firebase API key (apiKey) in auth.js is a client-side browser key. Firebase API keys for web apps are intentionally public — they identify your Firebase project, not a privileged server credential. Access is controlled entirely by Firebase Security Rules and Authentication, not by keeping the key secret. Do not treat it as a password or rotate it expecting to gain security.

Module Imports

auth.js loads Firebase entirely from the Google CDN using ES module imports — no npm install or bundler required:
auth.js
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.14.1/firebase-app.js";
import {
  getAuth,
  signInWithEmailAndPassword,
  createUserWithEmailAndPassword,
  signOut,
  onAuthStateChanged,
  sendPasswordResetEmail
} from "https://www.gstatic.com/firebasejs/10.14.1/firebase-auth.js";

Authentication Flow

Every protected page of GTCloud follows the same pattern:
  1. The page loads and immediately calls protectPage() as its first JS statement.
  2. protectPage() registers a listener with onAuthStateChanged. Firebase resolves the user’s session from its local cache almost instantly.
  3. If the listener fires with no user, the visitor is sent to /login.html via window.location.replace() (no back-button escape).
  4. If the listener fires with a valid user, the page renders normally and the user’s email is available throughout the session.
The inverse is handled by redirectIfLoggedIn() on the login and registration pages — authenticated users are bounced straight to /index.html so they never see the auth forms unnecessarily.

Exported API

protectPage()

protectPage
function
Guards any private page. Internally calls onAuthStateChanged(auth, callback). If the resolved user is null (unauthenticated), it immediately calls window.location.replace("/login.html"). If the user exists, it logs the authenticated email to the console and lets the page continue loading. Call this as the first statement in any module script on a protected page.

redirectIfLoggedIn()

redirectIfLoggedIn
function
Prevents already-authenticated users from viewing the login or registration pages. Calls onAuthStateChanged(auth, callback); if a user session is found, redirects to window.location.replace("/index.html"). Import and call this on /login.html and /registro.html.

logout()

logout
function
Signs the current user out. Calls signOut(auth) and on success redirects to /login.html via window.location.replace(). On failure it surfaces an alert() with the Firebase error message. Wire this to your Cerrar Sesión button.

auth

auth
Auth
The initialized Firebase Auth instance returned by getAuth(app). Re-exported so any page module can call Firebase Auth functions directly (e.g., onAuthStateChanged(auth, ...)) without re-initializing Firebase.

signInWithEmailAndPassword

signInWithEmailAndPassword
function (auth, email, password) => Promise<UserCredential>
Re-exported directly from the Firebase SDK. Used on /login.html to authenticate a returning user. Throws typed errors such as auth/user-not-found, auth/wrong-password, and auth/too-many-requests that the login form maps to user-friendly messages.

createUserWithEmailAndPassword

createUserWithEmailAndPassword
function (auth, email, password) => Promise<UserCredential>
Re-exported from the Firebase SDK. Used on /registro.html to create a new Firebase user. The registration form enforces a minimum password length of 6 characters and confirms that both password fields match before calling this function. Throws auth/email-already-in-use if the address is taken.

sendPasswordResetEmail

sendPasswordResetEmail
function (auth, email) => Promise<void>
Re-exported from the Firebase SDK. Used on /recuperar_contraseña.html to dispatch a password-reset email to the provided address. Firebase handles delivery; the user clicks the link in their inbox to set a new password. Throws auth/invalid-email and auth/user-not-found for validation errors.

Using protectPage() on a Protected Page

Every department agent page and the agentic tools catalog follow this exact pattern:
import { protectPage, logout, auth } from "./auth.js";
import { onAuthStateChanged } from "https://www.gstatic.com/firebasejs/10.14.1/firebase-auth.js";

// Lock this page immediately — unauthenticated users are redirected to /login.html
protectPage();

// Optional: show user info and wire up the logout button
onAuthStateChanged(auth, (user) => {
  if (user) {
    // Render personalized UI, e.g. "Hola, username"
    console.log("Authenticated user:", user.email);
  }
});

document.getElementById("logout-btn").addEventListener("click", () => {
  logout(); // Signs out and redirects to /login.html
});

User Registration

The registration flow at /registro.html collects name, email, password, and confirm password. Before calling Firebase, the form applies two client-side checks:
  1. Both password fields must match — otherwise the submission is blocked with “Las contraseñas no coinciden.”
  2. The password must be at least 6 characters long — the minimum Firebase enforces server-side anyway.
On a successful createUserWithEmailAndPassword call, a success banner appears and the user is redirected to /index.html after 2 seconds. Firebase automatically signs the new user in, so no separate login step is needed. The page also calls redirectIfLoggedIn() on load to prevent double-registration by already-authenticated users.

Password Recovery

The recovery page at /recuperar_contraseña.html provides a single email field. On submission it calls sendPasswordResetEmail(auth, email). Firebase sends a reset link to the provided address. The page handles three specific error codes for clear user feedback:
Firebase error codeMessage shown
auth/invalid-emailEl email no tiene un formato válido.
auth/user-not-foundNo existe cuenta con este email.
auth/too-many-requestsDemasiados intentos. Espera unos minutos.
After clicking the link in the reset email, the user sets a new password on Firebase’s hosted UI and is returned to the platform login page.

Build docs developers (and LLMs) love