MongocampAccount
A "my account" page for the currently logged-in user — view profile, change password, and regenerate the API key. Unlike every other component, this one is scoped to "the current user," not an admin-managed list of other users/resources.
Usage
<template>
<MongocampAccount />
</template>Mount it under /secured (not /secured/admin) — any logged-in user should be able to reach their own account page, not just admins.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
hideSessions | boolean | false | Hide the Sessions card (and send no request for it). |
Operates on the currently logged-in user via useMongocampAccount.
Profile card
Read-only: user, isAdmin (as a badge), and roles (as a badge list), fetched fresh from fetchProfile() on mount. Server 3.0 user fields when the profile has them: the display name under the user id, the e-mail address with a Verified / Not verified badge, and the last login. The display name can be changed right there (server 3.1 PATCH /auth/profile, pencil button → input, Enter or Save; empty removes it; a refusal stays in the editor; not in proxy mode). E-mail and verification are changed by an administrator in MongocampUsers — the server has no own-address route yet.
Change Password
A single-field FUDataEdit form (inputType: 'password', validation: 'required|length:3', matching MongocampLogin's rule).
API Key
- Regenerate is behind a confirmation modal — regenerating immediately invalidates the current key.
- The new key is displayed once, in a read-only copyable field with a visible warning that it won't be shown again (mirrors the copy-to-clipboard pattern in
MongocampCollectionInfos's "Copy as TS Interface" button). A "Dismiss" button clears it from view once you've copied it. - The component does not display the current API key anywhere — the server only returns a usable key at the moment it's (re)generated.
Sessions
Server 3.0 with AUTH_SESSIONS=true: where the user is signed in, from useMongocampSessions — one row per session with a short device name (Chrome · macOS), the address, last use, sign-in time and expiry; the current session first, marked This device. End signs one other session out at once, End other sessions (n) all others (the current one stays — use the app's logout for it); both reload the list and toast, a refusal stays in the card with the reason. Without sessions on the server (404) the card is not shown; in proxy mode it is never asked.
Server proxy mode
With useServerProxy the profile is the user of the server's api key. The component shows it with an info note and leaves out Change Password and API Key: a new password or key for that user would cut off the proxy. See server proxy auth.