Authdog

Remix

Authentication that fits Remix

Add login and route protection with the primitives Remix already gives you: loaders, actions, and cookie sessions. Authdog slots into the web-fundamentals model instead of replacing it.

One line per route
A single requireUser(request) call gates a route and hands your loader a verified user. No middleware indirection.
Works without client JS
Auth flows are form posts handled by actions, so login and logout keep working with JavaScript disabled or still loading.
No tokens in the browser
Sessions stay in signed, HTTP-only cookies read only on the server, leaving nothing for client code to leak.
Nested route aware
Parent loaders gate whole sections while child routes inherit the verified user.

Guard a loader

// app/routes/dashboard.tsx
import { requireUser } from "@authdog/remix"

export async function loader({ request }) {
  const user = await requireUser(request)
  return json({ user })
}

Log in with an action

// app/routes/login.tsx
import { authenticator } from "@authdog/remix"

export async function action({ request }) {
  return authenticator.login(request, {
    successRedirect: "/dashboard",
  })
}

Web fundamentals, not magic

Everything Remix apps need

Auth that works with loaders, actions, and progressive enhancement, just as the framework was designed.

01

Loaders & actions

Protect a route by calling requireUser() in its loader, and run logins from an action. Auth lives on the server, right where your data does.

  • requireUser() in loaders
  • Logins from actions
03

Nested routes

Enforce auth at any level of your nested route tree. Parent loaders gate whole sections while child routes inherit the verified user.

  • Gate whole sections
  • Children inherit the user
04

Progressive enhancement

Login and logout work as plain HTML form posts, so they keep working before JavaScript loads, exactly the way Remix intends.

  • Plain HTML form posts
  • No JS required
05

Automatic token refresh

Tokens are refreshed transparently inside your loaders. Expired sessions renew without an extra round trip you have to write.

  • Refreshed in loaders
  • No extra round trip
06

Typed SDK

A fully typed SDK gives you autocomplete for the user, claims, and roles returned to your loaders and actions.

  • User, claims, and roles
  • Autocomplete everywhere
01

Install

Add @authdog/remix-node and your environment keys.

02

Wire sessions

Point the SDK at your Remix cookie session storage, once.

03

Guard routes

Call requireUser(request) in the loaders you protect.

Add auth to your Remix app.

Install the SDK, wire up your session storage, and protect your loaders today. Free to start, with secure defaults built in.