Skip to content

LoginMenu

Open the avatar menu to log in or manage the current account.

Playground

Usage

Choose Log in in the avatar menu to open LoginModal. Choosing a provider signs you in locally for this demo.

<script lang="ts">
import { LoginMenu, type LoginUser } from '@allmaps/ui/auth'
let {
user,
signOut
}: {
user: LoginUser | null
signOut: () => Promise<void>
} = $props()
</script>
<LoginMenu {user} onSignOut={signOut} />

Props

Prop Behavior
user Pass the app’s session user to show their photo or the Allmaps MapMonster and the Log out action. Pass null for a guest.
apiBaseUrl Allmaps API root used to discover enabled providers when the modal opens. Defaults to https://api.allmaps.org.
signInProviders Optional preloaded list of provider links. Omit to discover all enabled providers and return to the current page after login.
signInURL Optional direct login URL. Used when no explicit provider links are supplied, and skips discovery.
onSignOut App callback that ends the session and updates the user. Throw on failure to display a retry message.
accountLinks Optional array of { label, href } links to show above Log out.