@authup/client-account-console
@authup/client-account-console
The Authup account console: a Vue single-page app where users manage their own account.
A built bundle with no process of its own, served by @authup/server-account-console or by any static host.
Installation · Usage · Configuration · Documentation
Where it fits
The package ships dist/ and nothing else: no server, no binary. @authup/server-account-console depends on it and serves it at <publicUrl>/console/account, which is what authup start does. Its pages cover the profile, the password, authenticators (TOTP, recovery codes, email codes, passkeys), connected external accounts, sessions and the applications a user has granted access to.
Link your users to <publicUrl>/console/account?ref=<your app's URL>: the console renders a back link to the application they came from.
Install the package directly only to host the console on another static host, or to substitute a fork of it through accountConsole.path.
Installation
npm install @authup/client-account-console
The bundle is under node_modules/@authup/client-account-console/dist.
Usage
Served by Authup
Nothing to configure. The service injects the runtime configuration into the shell on every request, validates ref against the trusted origins, and the console signs in with an HttpOnly session cookie on the API's own origin, so no token is held in JavaScript.
ACCOUNT_CONSOLE_ENABLED=falsemakes the console render a disabled notice and turns its server-side login off.ACCOUNT_CONSOLE_PATHpoints the service at a substituted package directory instead of this one.
Hosted on its own
-
Serve
dist/under/console/account/, the base the bundle was built with, and answer every deep link withindex.html. -
Replace the
<!--account-config-->marker inindex.htmlwith the configuration:<script>window.__AUTHUP__ = { apiUrl: 'https://auth.example.com' };</script> -
Add the host's origin to the server's
TRUSTED_ORIGINS, so the per-realmaccount-consoleclient accepts the redirect back.
On a foreign origin the session cookie cannot be presented, so the console signs in through the authorization code flow with PKCE in the browser instead.
Runtime configuration
window.__AUTHUP__ may carry:
| Key | Type | Default | Description |
|---|---|---|---|
apiUrl |
string |
the page's origin plus any prefix in front of /console/account |
The API base URL |
basePath |
string |
/console/account |
The router base |
ref |
string |
none | The back-link target. The app never reads ref from its own URL, so a static host that wants one validates it and injects it here |
cookieSession |
boolean |
false |
Set by the serving service: it implements the cookie-mode login routes. Applies only when apiUrl is the page's own origin |
features.accountConsole |
boolean |
true |
false renders the disabled notice |
Development
From the repository root, npm run dev serves this console through Vite with hot module replacement at http://localhost:3000/console/account, on the API's own origin.
On its own, against a running Authup server:
VITE_API_URL=http://localhost:3000 npm run dev # Vite on http://localhost:5173/console/account/
npm run build # dist/, what the service serves
Outside production http://localhost:5173 is a trusted origin by default, so the sign-in redirect works without configuration. The port is strict, so only one console's standalone dev server can run at a time; run the other through npm run dev at the root.
Notes
- A missing marker fails silently. Without
<!--account-config-->replaced, the console still loads and derives the API URL from its own location, which is only right when it is served on the API's origin. - The asset base is fixed at build time.
index.htmlreferences its assets under/console/account/. The service rewrites those references for any other published path; a static host serving the bundle elsewhere has to do the same or rebuild with another Vite base.
License
Made with 💚
Published under the AGPL-3.0. A commercial license is available; see LICENSING.md.
Related Packages
The Authup admin console: a Vue single-page app for managing realms, users, clie...
Authup's hosted login, consent, registration, password recovery and device pages...
Vue 3 components, a Pinia session store and permission checks for apps that sign...
ARIA authentication Vue 3 adapter — AriaIamPlugin, useAuth, usePermissions and P...
Version History
Pre-releases (13)
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.0-beta.71 | ^3.5.44 | AGPL-3.0-only | |
| 1.0.0-beta.70 | ^3.5.44 | AGPL-3.0-only | |
| 1.0.0-beta.69 | ^3.5.43 | AGPL-3.0-only | |
| 1.0.0-beta.68 | ^3.5.43 | AGPL-3.0-only | |
| 1.0.0-beta.67 | ^3.5.43 | AGPL-3.0-only | |
| 1.0.0-beta.66 | ^3.5.43 | AGPL-3.0-only | |
| 1.0.0-beta.65 | ^3.5.42 | AGPL-3.0-only | |
| 1.0.0-beta.64 | ^3.5.42 | AGPL-3.0-only | |
| 1.0.0-beta.63 | ^3.5.41 | AGPL-3.0-only | |
| 1.0.0-beta.62 | ^3.5.41 | AGPL-3.0-only | |
| 1.0.0-beta.61 | ^3.5.40 | AGPL-3.0-only | |
| 1.0.0-beta.60 | ^3.5.40 | AGPL-3.0-only | |
| 1.0.0-beta.59 | ^3.5.40 | AGPL-3.0-only |