Server-side helpers for onboarding flow and user checks.
// Source: https://github.com/janhesters/react-router-saas-template | License: MIT | Copyright 2025 Jan Hesters
// Provided via justclaw.it.com; keep this notice with the code.
import type { RouterContextProvider } from "react-router";
import { href, redirect } from "react-router";
import { throwIfUserAccountIsMissing } from "../user-accounts/user-accounts-helpers.server";
import { retrieveUserAccountWithMembershipsFromDatabaseBySupabaseUserId } from "../user-accounts/user-accounts-model.server";
import { authContext } from "../user-authentication/user-authentication-middleware.server";
import { asyncPipe } from "~/utils/async-pipe.server";
/**
* Requires that a user account exists for the authenticated user.
* Retrieves the user's account with their memberships from the database.
*
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key