@authup/client-auth-console 1.0.0-beta.69 → 1.0.0-beta.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -32
- package/dist/client/.vite/ssr-manifest.json +110 -0
- package/dist/client/assets/index-oZXM2RN4.js +97 -0
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +407 -135
- package/package.json +11 -11
- package/dist/client/assets/index-UI54EPIA.js +0 -97
package/README.md
CHANGED
|
@@ -1,40 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/authup/authup/master/.github/assets/logo.svg" alt="Authup logo" width="96" height="96" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">@authup/client-auth-console</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<b>Authup's hosted login, consent, registration, password recovery and device pages, as a server-rendered Vue bundle.</b><br>
|
|
9
|
+
Rendered by @authup/server-auth-console; replace it with your own package to reskin the pages.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/@authup/client-auth-console"><img src="https://img.shields.io/npm/v/@authup/client-auth-console" alt="npm version" /></a>
|
|
14
|
+
<a href="https://github.com/authup/authup/actions/workflows/main.yml"><img src="https://github.com/authup/authup/actions/workflows/main.yml/badge.svg" alt="CI" /></a>
|
|
15
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-blue" alt="License: AGPL-3.0" /></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="#installation"><b>Installation</b></a> · <a href="#usage">Usage</a> · <a href="#render-contract">Render contract</a> · <a href="https://authup.org">Documentation</a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Where it fits
|
|
25
|
+
|
|
26
|
+
The package renders the pages a person sees while signing in: `/authorize` (login, second factor, consent), `/register`, `/activate`, `/password-forgot`, `/password-reset`, `/device` (device verification) and `/logout`. It ships a built `dist/` plus the type file of its render contract, and no process. [`@authup/server-auth-console`](https://github.com/authup/authup/tree/master/apps/server-auth-console) depends on it, renders each request through `dist/server/server.js` with a per-request hydration payload, and serves `dist/client/assets`.
|
|
27
|
+
|
|
28
|
+
These pages cannot be hosted on their own: passkeys are bound to the identity provider's origin, the session cookies they read are first-party there, and every page has a `POST` twin on the same path of the API. Install this package directly only to build a replacement against its types.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```shell
|
|
33
|
+
npm install @authup/client-auth-console
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Its one runtime dependency, `@authup/core-http-kit`, is there because the render contract's types reference the HTTP client.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Reskin the pages
|
|
41
|
+
|
|
42
|
+
Theming (colors, logo, favicon, a stylesheet) needs no new package: mount a theme directory and set `THEME_DIRECTORY_PATH`. To change the markup, publish a package that fulfills the render contract below and point the service at its directory:
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
AUTH_CONSOLE_PATH=/opt/my-auth-pages authup start
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The directory needs:
|
|
49
|
+
|
|
50
|
+
| File | Purpose |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `dist/client/index.html` | The page template, with `<!--app-html-->` for the rendered markup and `<!--preload-links-->` in the head |
|
|
53
|
+
| `dist/client/.vite/ssr-manifest.json` | The module-to-asset map the render uses for preload links |
|
|
54
|
+
| `dist/client/assets/` | The client assets, served under the service's `/assets` |
|
|
55
|
+
| `dist/server/server.js` | An ES module exporting `render` and `CONTRACT_VERSION` |
|
|
56
|
+
|
|
57
|
+
The service checks `CONTRACT_VERSION` at boot and refuses any value other than the one it was built for.
|
|
58
|
+
|
|
59
|
+
## Render contract
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import type { RenderContext, RenderFunction, RenderResult } from '@authup/client-auth-console';
|
|
63
|
+
|
|
64
|
+
export const CONTRACT_VERSION = 5;
|
|
65
|
+
|
|
66
|
+
export const render: RenderFunction = async (ctx: RenderContext): Promise<RenderResult> => {
|
|
67
|
+
const html = await renderPage(ctx.url, ctx.payload);
|
|
68
|
+
|
|
69
|
+
return [html, ''];
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
| Type | Fields |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `RenderContext` | `url` (the page path), `manifest` (the SSR manifest), `payload` (`HydrationPayload`), `httpClient?` (a client to use instead of one built from `payload.config.baseURL`), `cookies?` (the visitor's access token cookie, on `/authorize` only) |
|
|
76
|
+
| `HydrationPayload` | `config.baseURL` (the API URL the browser reaches), `data` (the page's own data), `hydration?` (results produced during the render, for the client to adopt) |
|
|
77
|
+
| `RenderResult` | `[html, preloadLinks]` |
|
|
78
|
+
|
|
79
|
+
The render puts `payload` into its own output for the client half to hydrate from; the built-in one appends it as `window.__AUTHUP__`. The service splices the two strings of `RenderResult` into the template's markers.
|
|
80
|
+
|
|
81
|
+
| `CONTRACT_VERSION` | Added |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `1` | The contract (also what a bundle without the export counts as) |
|
|
84
|
+
| `2` | The federated callback's interstitial route and payload |
|
|
85
|
+
| `3` | `federatedLogin` on `/authorize`: the page completes a login that returned from an external provider |
|
|
86
|
+
| `4` | The `/device` page |
|
|
87
|
+
| `5` | `federatedLogin` on `/device` |
|
|
20
88
|
|
|
21
89
|
## Development
|
|
22
90
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`@authup/server-auth-console`'s own handler on server-core's listener, so an
|
|
29
|
-
edit here shows up on the next request with no build step. See
|
|
30
|
-
`.agents/architecture.md` → *Development mode* for how it works.
|
|
91
|
+
There is no `dev` script here. `npm run dev` at the repository root detects this package as a source checkout and serves it through a Vite dev server with hot module replacement, in front of the auth console service on `http://localhost:3000`. Edits to this package and to `@authup/client-web-kit` show up on the next request.
|
|
92
|
+
|
|
93
|
+
```shell
|
|
94
|
+
npm run build # dist/client and dist/server, what the service renders
|
|
95
|
+
```
|
|
31
96
|
|
|
32
|
-
##
|
|
97
|
+
## Notes
|
|
33
98
|
|
|
34
|
-
|
|
99
|
+
- **The version only rises.** A replacement built for an older version is refused at boot, so bump it together with the service.
|
|
100
|
+
- **Never forward the refresh token.** `cookies` carries the access token alone; a render cannot hand a rotated token pair back to the browser.
|
|
101
|
+
- **`httpClient` is per render.** It carries the visitor's bearer once the session resolves, so a host builds one per request and never shares it.
|
|
35
102
|
|
|
36
103
|
## License
|
|
37
104
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
105
|
+
Made with 💚
|
|
106
|
+
|
|
107
|
+
Published under the [AGPL-3.0](./LICENSE). A commercial license is available; see [LICENSING.md](https://github.com/authup/authup/blob/master/LICENSING.md).
|
|
@@ -24474,6 +24474,116 @@
|
|
|
24474
24474
|
"/console/auth/assets/asap-latin-700-normal-Dqcopq14.woff",
|
|
24475
24475
|
"/console/auth/assets/favicon-CEtVE1SK.svg"
|
|
24476
24476
|
],
|
|
24477
|
+
"../../packages/access/src/permission/record/index.ts": [
|
|
24478
|
+
"/console/auth/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2",
|
|
24479
|
+
"/console/auth/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff",
|
|
24480
|
+
"/console/auth/assets/nunito-cyrillic-300-normal-BPQV259B.woff2",
|
|
24481
|
+
"/console/auth/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff",
|
|
24482
|
+
"/console/auth/assets/nunito-vietnamese-300-normal-mLneKULB.woff2",
|
|
24483
|
+
"/console/auth/assets/nunito-vietnamese-300-normal-DATld5Vw.woff",
|
|
24484
|
+
"/console/auth/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2",
|
|
24485
|
+
"/console/auth/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff",
|
|
24486
|
+
"/console/auth/assets/nunito-latin-300-normal-COoPE5VN.woff2",
|
|
24487
|
+
"/console/auth/assets/nunito-latin-300-normal-C3ZIKvzv.woff",
|
|
24488
|
+
"/console/auth/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2",
|
|
24489
|
+
"/console/auth/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff",
|
|
24490
|
+
"/console/auth/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2",
|
|
24491
|
+
"/console/auth/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff",
|
|
24492
|
+
"/console/auth/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2",
|
|
24493
|
+
"/console/auth/assets/nunito-vietnamese-400-normal-DtOtW02z.woff",
|
|
24494
|
+
"/console/auth/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2",
|
|
24495
|
+
"/console/auth/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff",
|
|
24496
|
+
"/console/auth/assets/nunito-latin-400-normal-r8SDr6Up.woff2",
|
|
24497
|
+
"/console/auth/assets/nunito-latin-400-normal-DKg4f3fz.woff",
|
|
24498
|
+
"/console/auth/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2",
|
|
24499
|
+
"/console/auth/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff",
|
|
24500
|
+
"/console/auth/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2",
|
|
24501
|
+
"/console/auth/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff",
|
|
24502
|
+
"/console/auth/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2",
|
|
24503
|
+
"/console/auth/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff",
|
|
24504
|
+
"/console/auth/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2",
|
|
24505
|
+
"/console/auth/assets/nunito-latin-ext-600-normal-BKUpuB78.woff",
|
|
24506
|
+
"/console/auth/assets/nunito-latin-600-normal-Br8yIETf.woff2",
|
|
24507
|
+
"/console/auth/assets/nunito-latin-600-normal-Cd0eNu1l.woff",
|
|
24508
|
+
"/console/auth/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2",
|
|
24509
|
+
"/console/auth/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff",
|
|
24510
|
+
"/console/auth/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2",
|
|
24511
|
+
"/console/auth/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff",
|
|
24512
|
+
"/console/auth/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2",
|
|
24513
|
+
"/console/auth/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff",
|
|
24514
|
+
"/console/auth/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2",
|
|
24515
|
+
"/console/auth/assets/nunito-latin-ext-700-normal-D4woHhbd.woff",
|
|
24516
|
+
"/console/auth/assets/nunito-latin-700-normal-Dort48En.woff2",
|
|
24517
|
+
"/console/auth/assets/nunito-latin-700-normal-OcDqTBcA.woff",
|
|
24518
|
+
"/console/auth/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2",
|
|
24519
|
+
"/console/auth/assets/asap-vietnamese-400-normal-lfLaoF2x.woff",
|
|
24520
|
+
"/console/auth/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2",
|
|
24521
|
+
"/console/auth/assets/asap-latin-ext-400-normal-C-fcRdtE.woff",
|
|
24522
|
+
"/console/auth/assets/asap-latin-400-normal-DnZ1MOsG.woff2",
|
|
24523
|
+
"/console/auth/assets/asap-latin-400-normal-Dc37g3Il.woff",
|
|
24524
|
+
"/console/auth/assets/asap-vietnamese-700-normal-D-SxY94i.woff2",
|
|
24525
|
+
"/console/auth/assets/asap-vietnamese-700-normal-B-e19ug5.woff",
|
|
24526
|
+
"/console/auth/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2",
|
|
24527
|
+
"/console/auth/assets/asap-latin-ext-700-normal-D00OESsZ.woff",
|
|
24528
|
+
"/console/auth/assets/asap-latin-700-normal-l2Y8pi-F.woff2",
|
|
24529
|
+
"/console/auth/assets/asap-latin-700-normal-Dqcopq14.woff",
|
|
24530
|
+
"/console/auth/assets/favicon-CEtVE1SK.svg"
|
|
24531
|
+
],
|
|
24532
|
+
"../../packages/access/src/permission/record/module.ts": [
|
|
24533
|
+
"/console/auth/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2",
|
|
24534
|
+
"/console/auth/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff",
|
|
24535
|
+
"/console/auth/assets/nunito-cyrillic-300-normal-BPQV259B.woff2",
|
|
24536
|
+
"/console/auth/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff",
|
|
24537
|
+
"/console/auth/assets/nunito-vietnamese-300-normal-mLneKULB.woff2",
|
|
24538
|
+
"/console/auth/assets/nunito-vietnamese-300-normal-DATld5Vw.woff",
|
|
24539
|
+
"/console/auth/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2",
|
|
24540
|
+
"/console/auth/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff",
|
|
24541
|
+
"/console/auth/assets/nunito-latin-300-normal-COoPE5VN.woff2",
|
|
24542
|
+
"/console/auth/assets/nunito-latin-300-normal-C3ZIKvzv.woff",
|
|
24543
|
+
"/console/auth/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2",
|
|
24544
|
+
"/console/auth/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff",
|
|
24545
|
+
"/console/auth/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2",
|
|
24546
|
+
"/console/auth/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff",
|
|
24547
|
+
"/console/auth/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2",
|
|
24548
|
+
"/console/auth/assets/nunito-vietnamese-400-normal-DtOtW02z.woff",
|
|
24549
|
+
"/console/auth/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2",
|
|
24550
|
+
"/console/auth/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff",
|
|
24551
|
+
"/console/auth/assets/nunito-latin-400-normal-r8SDr6Up.woff2",
|
|
24552
|
+
"/console/auth/assets/nunito-latin-400-normal-DKg4f3fz.woff",
|
|
24553
|
+
"/console/auth/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2",
|
|
24554
|
+
"/console/auth/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff",
|
|
24555
|
+
"/console/auth/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2",
|
|
24556
|
+
"/console/auth/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff",
|
|
24557
|
+
"/console/auth/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2",
|
|
24558
|
+
"/console/auth/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff",
|
|
24559
|
+
"/console/auth/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2",
|
|
24560
|
+
"/console/auth/assets/nunito-latin-ext-600-normal-BKUpuB78.woff",
|
|
24561
|
+
"/console/auth/assets/nunito-latin-600-normal-Br8yIETf.woff2",
|
|
24562
|
+
"/console/auth/assets/nunito-latin-600-normal-Cd0eNu1l.woff",
|
|
24563
|
+
"/console/auth/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2",
|
|
24564
|
+
"/console/auth/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff",
|
|
24565
|
+
"/console/auth/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2",
|
|
24566
|
+
"/console/auth/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff",
|
|
24567
|
+
"/console/auth/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2",
|
|
24568
|
+
"/console/auth/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff",
|
|
24569
|
+
"/console/auth/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2",
|
|
24570
|
+
"/console/auth/assets/nunito-latin-ext-700-normal-D4woHhbd.woff",
|
|
24571
|
+
"/console/auth/assets/nunito-latin-700-normal-Dort48En.woff2",
|
|
24572
|
+
"/console/auth/assets/nunito-latin-700-normal-OcDqTBcA.woff",
|
|
24573
|
+
"/console/auth/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2",
|
|
24574
|
+
"/console/auth/assets/asap-vietnamese-400-normal-lfLaoF2x.woff",
|
|
24575
|
+
"/console/auth/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2",
|
|
24576
|
+
"/console/auth/assets/asap-latin-ext-400-normal-C-fcRdtE.woff",
|
|
24577
|
+
"/console/auth/assets/asap-latin-400-normal-DnZ1MOsG.woff2",
|
|
24578
|
+
"/console/auth/assets/asap-latin-400-normal-Dc37g3Il.woff",
|
|
24579
|
+
"/console/auth/assets/asap-vietnamese-700-normal-D-SxY94i.woff2",
|
|
24580
|
+
"/console/auth/assets/asap-vietnamese-700-normal-B-e19ug5.woff",
|
|
24581
|
+
"/console/auth/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2",
|
|
24582
|
+
"/console/auth/assets/asap-latin-ext-700-normal-D00OESsZ.woff",
|
|
24583
|
+
"/console/auth/assets/asap-latin-700-normal-l2Y8pi-F.woff2",
|
|
24584
|
+
"/console/auth/assets/asap-latin-700-normal-Dqcopq14.woff",
|
|
24585
|
+
"/console/auth/assets/favicon-CEtVE1SK.svg"
|
|
24586
|
+
],
|
|
24477
24587
|
"../../packages/access/src/policy/built-in/attribute-names/evaluator.ts": [
|
|
24478
24588
|
"/console/auth/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2",
|
|
24479
24589
|
"/console/auth/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff",
|