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 ZustandDocumentation 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.
authStore keeps the React layer in sync. Protected routes check isInitialized and session before rendering, redirecting unauthenticated visitors to /login.
Email/password login
Enter credentials
The user fills in their email and password on the login page and submits the form.
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.Google OAuth login
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.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.Password recovery
The recovery flow uses a magic link sent by Supabase:- The user submits their email on the forgot-password page.
authService.resetPasswordcallssupabase.auth.resetPasswordForEmail(email, { redirectTo: window.location.origin + '/reset-password' }).- Supabase sends an email with a one-time recovery link.
- Clicking the link opens
/reset-passwordwith a valid session. The user sets a new password viasupabase.auth.updateUser.
Session persistence
The Supabase JS client handles session persistence without any custom code. On initialization, it reads the stored session fromlocalStorage, 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.