spences10/devhub-crm · Archived

auth-patterns

Better-auth integration for authentication. Use when implementing login, registration, protected routes, or email verification.

First seen Mar 13, 2026

Installation

$ npx skills add spences10/devhub-crm --skill auth-patterns

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from spences10/devhub-crm.

npx skills add spences10/devhub-crm

Browse all from spences10/devhub-crm

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 6
Default branch main
Open issues 1
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,172 B
  • docs README.md 456 B
  • docs SUMMARY.md 166 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 4 installs

SKILL.md

Auth Patterns

Quick Pattern

// Login form
export const login = form(schema, async ({ email, password }) => {
	const event = getRequestEvent();
	await auth.api.signInEmail({
		body: { email, password },
		headers: event.request.headers,
	});
	redirect(303, '/dashboard'); // Outside try/catch
});

// Protected query
export const get_data = guarded_query(() => {
	return { message: 'Protected data' };
});

Core Principles

  • Use getRequestEvent() for headers (cookie access)
  • Redirect MUST be outside try/catch (throws error)
  • Use guarded_query/form/command for protected endpoints
  • Email verification required before login
  • Commands cannot redirect - use client-side goto()

Reference Files

  • [auth-setup.md](references/auth-setup.md) - Complete better-auth

configuration

  • [auth-usage.md](references/auth-usage.md) - All auth patterns and

examples

  • [email-verification.md](references/email-verification.md) - Email

verification flow