FrontierJS

Auth

API · Identity@frontierjs/auth

A route establishes a session. Everything after it is an ordinary service.

$ npm i @frontierjs/auth

Sessions

Register · login · logout · password reset · email verify

Login cannot be gated by login, so these five are raw routes and always will be. Everything past that line is a service with the normal pipeline over it.

Replaces

Auth.jsLuciaPassportClerk

Cookies

cookieAuth: true authenticates end to end

One session works for a fetch, for a browser navigation and for an OAuth callback — which is a redirect, and cannot carry a bearer header.

Replaces

session middleware beside a second token scheme

OAuth

The flow engine is split from the transport

Building the URL, trading the code and normalizing the identity are one module with no HTTP, no database and no session in it. The plugin owns the routes; the provider list is data.

Replaces

Passport strategies

Two-factor

TOTP, base32 and recovery codes — clockless

RFC 6238 with the instant as a parameter rather than a read of the clock, so a code is testable and a drifting device is a value you pass in.

Replaces

otplib wired by handspeakeasy

Services

account · sessions · api-keys

What a signed-in person does next is not a route. Three ordinary services, gated like everything else, so there is no second authorization story for account management.

Replaces

bespoke /me endpoints

Schema

Two .lite files, split by who owns them

User is appended into your own schema so you can edit it; the machinery models are imported, so an upgrade reaches an installed app. extend model adjusts them at your end rather than by pasting.

extend model User {
  company String?
}

Replaces

copy-pasted auth tablesa migration you own forever

Hooks

Four awaited callbacks; a throw refuses the call

Each one runs BEFORE the thing it can refuse, so declining a registration is returning early rather than undoing a write.

Replaces

after-the-fact event listeners