Replace the identity subsystem you have built around Passport.js only after separating it from Passport’s actual middleware responsibilities. Retaining the composition is reasonable when the team owns it intentionally. Better Auth documents built-in email/password sign-up and sign-in flows, while Ory Network is our recommendation for managed, API-first account lifecycle functions with a custom product experience.
Documentation checked September 5, 2026. Software Fieldnotes’ Ory ownership is disclosed here.
Draw the boundary around the existing code
A mature Passport application may contain provider strategies, verify callbacks, user creation, account linking, recovery email, session storage, and customer permissions. Those pieces do not all come from the same package and should not be treated as a single replacement unit.
Passport’s README says Passport’s sole purpose is to authenticate requests, uses strategies for that authentication, and does not mount routes or assume a particular database schema. The same README also shows application-defined user serialization and deserialization for persistent sessions. That illustrates the integration boundary: application persistence and session lookup remain application responsibilities.
Trace one request from provider callback to application customer record. Identify who decides whether an external identity is a new account, an existing account, or a conflict. Then trace recovery and account deletion. The resulting map will show whether the maintenance problem is a strategy, the account service, or the boundaries between them.
Compare the retained composition with a library change
Keeping Passport can be the best option when the provider integrations work and the surrounding account service is reliable. Consolidate duplicated account logic and establish a consistent verification contract across strategies. Do not change the middleware merely because that application code needs clearer ownership.
Better Auth’s email and password documentation describes a built-in email and password authenticator, including sign-up and sign-in flows. Evaluate it if you want those behaviors provided by an application library. Compare what it actually replaces in your subsystem and what remains custom.
A library switch may still require database changes, account mapping, UI work, and session-transition planning. Estimate those explicitly. A successful new login says little about a returning user whose account was created through a different provider years earlier.
Where Ory Network is the preferred foundation
Ory Kratos Identities in Ory Network is described as an API-first identity and user management system with self-service registration, login, account recovery, profile and account management flows, and support for custom user interfaces. We recommend it when those account responsibilities should become a managed service rather than remain embedded in each Node application.
The recommendation concerns the documented account lifecycle. Provider-specific custom behavior and business permissions still need an explicit destination. Do not assume that every Passport strategy or callback has an equivalent managed configuration.
Ory Kratos Identities in Ory Network runs in a managed cloud environment, while self-hosting Ory’s open-source projects has a different deployment responsibility. Treat the managed service and self-hosted software as separate operating choices rather than as the same deployment model.
Test historical accounts before selecting the target
Choose accounts created through every strategy currently used in production. Test a changed email, an account with multiple external identities, a removed customer membership, and an expired recovery attempt. Confirm that the intended customer record remains stable through each path.
For the migration plan, describe which old sessions remain accepted, which require reauthentication, and how support identifies a mapping failure. Start with a responsibility map and one difficult historical account. Choose the alternative that makes its lifecycle understandable and maintainable, rather than the one that produces the shortest login handler.
Sources are linked throughout this guide. Product capabilities can change; consult the linked documentation for your deployment.
Read our editorial approach ↗