Supabase Auth

مصادقة Supabase

Intermediateauthentication1 min read
supabase authenticationsupabase auth v2gotruesupabase magic link

Definition

Supabase's built-in authentication system supporting email/password, magic links, OAuth, and phone logins.

نظام المصادقة المدمج في Supabase الذي يدعم البريد الإلكتروني/كلمة المرور والروابط السحرية وOAuth وتسجيل الدخول بالهاتف.

Why It Matters

If 404Fault is ever migrated to Supabase from Firebase, Supabase Auth would replace Firebase Authentication. Understanding both helps you reason about the trade-offs.

إذا هُجِّرت 404Fault إلى Supabase من Firebase، ستحل مصادقة Supabase محل Firebase Authentication. فهم كلاهما يساعدك على قياس المفاضلات.

Full Definition

Supabase Auth is built on GoTrue, an open-source auth server. It provides email/password, magic link, OAuth (Google, GitHub, Twitter), and phone OTP authentication. Sessions are stored as JWT cookies. Row Level Security (RLS) in PostgreSQL can use `auth.uid()` to restrict data to the authenticated user. Supabase Auth is the Firebase Authentication equivalent in the Supabase ecosystem.
مصادقة Supabase مبنية على GoTrue، خادم مصادقة مفتوح المصدر. توفر البريد الإلكتروني/كلمة المرور والروابط السحرية وOAuth وOTP الهاتفي. الجلسات تُخزَّن كـJWT cookies. Row Level Security في PostgreSQL يمكنها استخدام `auth.uid()` لتقييد البيانات للمستخدم المصادق عليه.

Example Usage

const { data, error } = await supabase.auth.signInWithPassword({ email, password }); const { data: { user } } = await supabase.auth.getUser();

const { data, error } = await supabase.auth.signInWithPassword({ email, password }); const { data: { user } } = await supabase.auth.getUser();

Knowledge Graph

Avoid these mistakes when using Supabase Auth:

1

Not enabling RLS after setting up Supabase Auth — tables are publicly readable by default

2

Mixing Supabase Auth sessions with custom JWTs — use one auth system per app

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Supabase Auth.

Explain:
1. What is Supabase Auth and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Not enabling RLS after setting up Supabase Auth — tables are publicly readable by default, Mixing Supabase Auth sessions with custom JWTs — use one auth system per app
5. Best practices and production tips

Official Resources