본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.6k · #13137

authentication

하는 일

이 스킬은 Better Auth를 사용하는 Agent-Native 앱의 인증 방식을 설명합니다. 개발 모드와 운영 모드, 사용자 정의 경로 보호, 조직을 다룹니다. 로그인을 설정하거나 고치는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Agent-Native 앱에 가입이나 로그인을 추가할 때.
  • ✓로그인한 사용자만 쓸 수 있도록 사용자 정의 경로를 보호하고 싶을 때.
  • ✓사용자에게 세션 문제가 있고 원인을 찾아야 할 때.

스킬 링크

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/authentication/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/authentication/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Google 로그인을 선택지로 포함해서 내 Agent-Native 앱에 가입과 로그인을 설정해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 새 사용자가 처음 방문할 때 계정을 얻는 방식, 세션을 확인하는 방식, 운영 환경에서 쓸 수 있는 로그인 방법을 설명합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Authentication

Rule

Auth is powered by Better Auth with account-first design. Every new user creates an account on first visit. Use getSession(event) to authenticate custom routes; actions are auto-protected. Normal app HTML and React Router page-data responses are one impersonal, public-cacheable shell for every visitor. The client decides whether to render private UI or redirect to sign-in.

Auth Modes

Mode Behavior
Development (default) Real Better Auth — same flow as production. There is no auth bypass. On first run the framework auto-creates a throwaway dev account and signs you in without printing its credentials (disable with AGENT_NATIVE_DISABLE_AUTO_DEV_ACCOUNT=1), so you are not stuck at a login wall. getSession() returns the signed-in user or null — it never falls back to a sentinel identity.
Production (default) Magic-link-first Better Auth when outbound email is ready, with email/password fallback and social providers (Google, GitHub). Organizations built in.
AUTH_MODE=local Not a browser auth bypass, and never returns local@localhost. It only affects CLI/agent identity: it lets pnpm action / the local agent loop auto-bind to the single real signed-in dev user from the sessions table (see scripts/dev-session.ts). Browser login is unchanged.
AUTH_SKIP_EMAIL_VERIFICATION=1 QA/preview escape hatch for password-fallback accounts. Signup skips email verification and does not send the signup verification email. Local dev/test skips verification by default; set AUTH_SKIP_EMAIL_VERIFICATION=0 only when testing verification itself. It does not change magic-link delivery. Give test accounts a test-identity address, such as an-e2e-probe-you@example.com or one containing +qa-test-bot- (the rule is isTestIdentityEmail in packages/core/src/shared/qa-test-email.ts), so they stay out of metrics. Test identities still get sign-in, verification, password-reset, and org-invitation mail, but no share notices or other app email.
auth.requireEmailVerification Declares the password-signup verification policy for any environment, production included, via defineAppConfig({ auth: { requireEmailVerification: false } }) or AUTH_REQUIRE_EMAIL_VERIFICATION=0. A declared value outranks AUTH_SKIP_EMAIL_VERIFICATION and the per-environment default. false accepts an unverified address as a login credential; true with no email provider disables password signup instead of stranding accounts on a verification nobody can deliver.
AUTH_MAGIC_LINK=0 Force the email/password fallback even when outbound email is ready.
AUTH_DISABLED=true Skip login/signup entirely — every request runs as dev@local.test. For local dev, cloud previews, and internal demos only; not for production with real users.
ACCESS_TOKEN / ACCESS_TOKENS Static bearer fallback for MCP/connect clients that cannot use OAuth. Not browser auth and never a token login page.
Custom Pass your own getSession to autoMountAuth(app, { getSession }).

Auth emails (verify signup, reset password, magic link, email change) and org invites render through renderTransactionalEmail. An app changes their copy or design with overrideTransactionalEmail(id, render) from a server plugin, never by editing better-auth-instance.ts call sites. See /docs/deployment#email-templates.

Hosted Sign-In Pages and the Shared Wave

  • First-party server auth plugins use createToolkitAuthPlugin from @agent-native/toolkit/app/auth/server. It server-renders AuthPage and ResetPasswordPage before hydration. Direct Core createAuthPlugin calls leave generic fallback markup in the response and can flash before React replaces it.
  • AuthPage uses Toolkit's full-page WaveBackground for every auth view. The Agent-Native homepage hero and Calendar booking use the same renderer: Calendar's animated FFT ocean wave. Keep the background empty while WebGPU support is checked and when the ocean renderer is unavailable
자주 묻는 질문

개발 중에 로그인을 건너뛸 방법이 있나요?

이 스킬은 인증 우회 기능이 없다고 말합니다. 처음 실행하면 개발용 계정이 자동으로 만들어집니다.

사용자 정의 경로는 어떻게 보호하나요?

사용자 정의 경로는 세션 확인을 사용하고, 액션은 자동으로 보호된다고 설명합니다.

운영 환경에서는 어떤 로그인 옵션이 있나요?

매직 링크, 이메일과 비밀번호 대체 수단, Google과 GitHub 소셜 로그인을 언급합니다.

상세 정보

작성자의 원본 설명

How auth works in agent-native apps. Use when wiring login/signup, configuring auth modes, setting up organizations, protecting routes, or debugging session issues.

repo: BuilderIO/agent-native

인기도

GitHub 스타
7.6k
순위
#13137
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬