Files
fleet/templates/app/lib/auth/server.ts
CatoandClaude 07a66c2e7d feat(template): account mail through AccountKit's shared mailer, with the sign-in code (#460)
The account mails stay this app's own words, in the reader's language, with
HTML: the template is handed to createAuthMailer({ render, codes: true })
(AccountKit 0.26.1). The shared mailer checks the link's origin, skips
addresses that cannot receive mail and puts a six-digit code in the sign-in
link's email, which the template prints ("On another device? Type this
code ..."). The sign-in page then offers the field for it.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-03 00:50:40 +01:00

12 lines
477 B
TypeScript

import { createAuthRuntime } from "@bitbaum/accountkit/auth/next";
import { getDb, isDatabaseConfigured } from "@/lib/db/client";
import { authMail } from "@/lib/mail";
import { SITE } from "@/lib/site";
export const { GET, POST, getSession, requireUser, getAuth, authStatus } = createAuthRuntime({
site: { url: SITE.url, title: SITE.title, slug: SITE.slug },
getDatabase: getDb,
isDatabaseConfigured,
mail: authMail,
});
export type Auth = ReturnType<typeof getAuth>;