Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/S4nti4goCoder/cloudsyncpro/llms.txt

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

CloudSyncPro supports two authentication methods — email/password and Google OAuth — both backed by Supabase Auth. Session tokens are persisted automatically by the Supabase JS client, and a Zustand authStore keeps the React layer in sync. Protected routes check isInitialized and session before rendering, redirecting unauthenticated visitors to /login.

Email/password login

1

Enter credentials

The user fills in their email and password on the login page and submits the form.
2

Call signInWithPassword

authService.signInWithEmail calls supabase.auth.signInWithPassword({ email, password }). On success, Supabase returns a session object containing an access token and a refresh token.
3

Session stored and store updated

The Supabase JS client writes the session to localStorage automatically. The authStore is updated with setUser, setSession, and setProfile, and React Router navigates the user to /dashboard.

Google OAuth login

1

Click the Google button

The user clicks “Continue with Google” on the login or register page.
2

Redirect to Google via signInWithOAuth

authService.signInWithGoogle calls supabase.auth.signInWithOAuth({ provider: 'google', options: { redirectTo: window.location.origin + '/dashboard' } }). The browser is redirected to Google’s consent screen.
3

Google redirects to Supabase callback

After the user grants consent, Google redirects back to the Supabase Auth callback URL (https://<project>.supabase.co/auth/v1/callback), which exchanges the authorization code for a session.
4

Final redirect to /dashboard

Supabase redirects the browser to the redirectTo URL (/dashboard). The Supabase JS client picks up the session from the URL fragment, persists it to localStorage, and the authStore is initialized.

Password recovery

The recovery flow uses a magic link sent by Supabase:
  1. The user submits their email on the forgot-password page.
  2. authService.resetPassword calls supabase.auth.resetPasswordForEmail(email, { redirectTo: window.location.origin + '/reset-password' }).
  3. Supabase sends an email with a one-time recovery link.
  4. Clicking the link opens /reset-password with a valid session. The user sets a new password via supabase.auth.updateUser.

Session persistence

The Supabase JS client handles session persistence without any custom code. On initialization, it reads the stored session from localStorage, silently refreshes the access token if it has expired, and emits an SIGNED_IN event that the authStore listener picks up. This means a user who closes the tab and returns later is still authenticated without re-entering credentials. The authStore tracks an isInitialized flag (set to true once the first onAuthStateChange event fires) so that protected routes can distinguish between “loading” and “truly unauthenticated” before deciding whether to redirect.
Google OAuth requires additional setup in Google Cloud Console — you must add https://<project>.supabase.co/auth/v1/callback as an authorized redirect URI and your production domain as an authorized origin. See Supabase deployment for the full configuration steps.

Build docs developers (and LLMs) love