Backend2025년 3월 5일2분 읽기

Supabase Auth — 인증 시스템 구축 완벽 가이드

YS
YoungSam
조회 1720

이메일/패스워드 인증

import { createClient } from "@supabase/supabase-js";
const supabase = createClient(URL, ANON_KEY);

// 회원가입
const { data, error } = await supabase.auth.signUp({
  email: "user@example.com",
  password: "secure-password",
});

// 로그인
const { data } = await supabase.auth.signInWithPassword({
  email: "user@example.com",
  password: "secure-password",
});

OAuth 로그인

await supabase.auth.signInWithOAuth({
  provider: "google",
  options: { redirectTo: "http://localhost:3000/callback" },
});

RLS와 결합하면 행 수준 보안이 자동으로 적용됩니다.

SupabaseAuthAuthentication

댓글 0

아직 댓글이 없습니다.