<SignedInAccounts/> component
<SignedInAccounts /> surfaces the signed-in accounts attached to the current session. It matters when the product supports multi-account sessions and account switching.
Usage
The following example shows a basic usage of <SignedInAccounts />.
import { SignedInAccounts } from '@wacht/nextjs';export default function SignedInAccountsUsage() { return ( <> <SignedInAccounts /> </> );}Overview
Use it when the current session can hold more than one sign-in and the user needs a dedicated surface for switching between them or signing out of a specific account. It is the account-switching page, not the compact trigger.
Behavior
The component reads the current session, waits for loading to finish, and sends the user to sign-in if the session has no accounts attached. When accounts do exist, it shows the available sign-ins in one place and keeps the active account first.
Selecting an account switches to it, while the optional add-account path keeps the current session context intact and hands the user back through the normal sign-in flow.
If the user signs out from this surface, the active session is cleared and the component returns the user to the hosted sign-in path if one is configured.
Account switching
The switching flow is session-based rather than a one-off account picker. That means the component can keep the current redirect target and resume the same app destination after the user changes accounts.
The active account is rendered first so the current context stays obvious before the user chooses a different sign-in.
Add account
The add-account path is not a separate login widget. It is the same sign-in flow, opened from the current session so the user can add another account without losing their existing context.
Sign out
The component can sign out one account or clear the whole session depending on the current session shape. That is what keeps it useful for multi-account setups instead of just single-user apps.
When to use it
Use this page when you need a dedicated account-switching surface rather than the compact <UserButton /> dropdown.