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 —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.
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:| Property | Value |
|---|---|
projectId | ai-agents-gtcloud |
authDomain | ai-agents-gtcloud.firebaseapp.com |
storageBucket | ai-agents-gtcloud.firebasestorage.app |
messagingSenderId | 434277005102 |
| SDK version | 10.14.1 (modular / tree-shakeable) |
Module Imports
auth.js loads Firebase entirely from the Google CDN using ES module imports — no npm install or bundler required:
auth.js
Authentication Flow
Every protected page of GTCloud follows the same pattern:- The page loads and immediately calls
protectPage()as its first JS statement. protectPage()registers a listener withonAuthStateChanged. Firebase resolves the user’s session from its local cache almost instantly.- If the listener fires with no user, the visitor is sent to
/login.htmlviawindow.location.replace()(no back-button escape). - If the listener fires with a valid user, the page renders normally and the user’s email is available throughout the session.
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()
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()
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()
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
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
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
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
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:
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:
- Both password fields must match — otherwise the submission is blocked with “Las contraseñas no coinciden.”
- The password must be at least 6 characters long — the minimum Firebase enforces server-side anyway.
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 code | Message shown |
|---|---|
auth/invalid-email | El email no tiene un formato válido. |
auth/user-not-found | No existe cuenta con este email. |
auth/too-many-requests | Demasiados intentos. Espera unos minutos. |