Stirling-Tools/Stirling-PDF · error · Error
error.message
Error message
error.message
What it means
Thrown by AuthService.signUp() when supabase.auth.signUp() returns an error object. The error.message is propagated directly. Supabase auth errors cover duplicate email registration, weak password, invalid email format, rate limiting, and auth-service-disabled scenarios. This is the primary signup failure path.
Source
Thrown at frontend/editor/src/saas/routes/signup/AuthService.ts:19
import { supabase } from "@app/auth/supabase";
import { absoluteWithBasePath } from "@app/constants/app";
export const useAuthService = () => {
const signUp = async (email: string, password: string, name?: string) => {
console.log("[Signup] Creating account for:", email);
const { data, error } = await supabase.auth.signUp({
email: email.trim(),
password: password,
options: {
emailRedirectTo: absoluteWithBasePath("/auth/callback"),
data: { full_name: name },
},
});
if (error) {
console.error("[Signup] Sign up error:", error);
throw new Error(error.message);
}
if (data.user) {
console.log("[Signup] Sign up successful:", data.user);
return {
user: data.user,
session: data.session,
requiresEmailConfirmation: data.user && !data.session,
};
}
throw new Error("Unknown error occurred during signup");
};
const signInWithProvider = async (
provider: "github" | "google" | "apple" | "azure",
) => {
const { error } = await supabase.auth.signInWithOAuth({View on GitHub (pinned to 9ef20dcab8)
Solutions
- Read error.message for the specific Supabase auth error to determine the exact cause
- Validate email format and password strength client-side before calling signUp
- For 'User already registered', offer a sign-in or password-reset flow instead
- Check Supabase Dashboard > Authentication > Settings for minimum password length and email confirmation requirements
Example fix
// before
const { data, error } = await supabase.auth.signUp({ ... });
if (error) {
throw new Error(error.message);
}
// after (in the caller)
try {
await signUp(email, password, name);
} catch (e) {
if (e.message.includes('already registered')) {
showSignInPrompt(email);
} else {
setError(e.message);
}
} Defensive patterns
Strategy: validation
Validate before calling
// Validate email and password before calling signUp
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
throw new Error('Please enter a valid email address');
}
if (password.length < 6) {
throw new Error('Password must be at least 6 characters');
} Try / catch
try {
const result = await signUp(email, password, name);
if (result.requiresEmailConfirmation) {
showEmailConfirmationPrompt(email);
}
} catch (e) {
const msg = e instanceof Error ? e.message : 'Sign up failed';
if (msg.includes('already registered')) {
redirectToSignIn(email);
} else {
setFormError(msg);
}
} Prevention
- Validate email format and password strength client-side before calling supabase.auth.signUp
- Check for duplicate emails with a lightweight lookup if available before full signup
- Map known Supabase error messages to user-friendly guidance (e.g. 'already registered' → sign-in prompt)
When it happens
Trigger: User registers with an email that already exists ('User already registered'); password doesn't meet the configured minimum length; email fails Supabase validation; the Supabase project has email auth disabled; rate limit exceeded.
Common situations: Duplicate email signup attempt; password too short (Supabase default min 6 chars but configurable); typo in email; Supabase auth rate limiting on repeated attempts.
Related errors
- Unknown error occurred during signup
- Sign up failed
- No SaaS session
- Timed out waiting for anonymous session token
- Email missing for this user. Please contact support for manu
AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13).
Data as JSON: /api/errors/2f93bd7f4015d6da.
Report an issue: GitHub.