@zitadel/components 0.1.0-alpha.4 → 0.1.0-alpha.8
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 +33 -19
- package/dist/atoms/index.d.mts +1 -1
- package/dist/atoms/index.mjs +1 -1
- package/dist/{atoms-Dh5J7QwT.mjs → atoms-B25wiDqb.mjs} +2 -2
- package/dist/atoms-B25wiDqb.mjs.map +1 -0
- package/dist/default-Cpl78hQN.mjs +6 -0
- package/dist/default-Cpl78hQN.mjs.map +1 -0
- package/dist/{index-DQryonsO.d.mts → index-DVDCrfkv.d.mts} +360 -337
- package/dist/index-DVDCrfkv.d.mts.map +1 -0
- package/dist/{index-D0NA2hMc.d.mts → index-DZ82Y3_z.d.mts} +6 -6
- package/dist/{index-D0NA2hMc.d.mts.map → index-DZ82Y3_z.d.mts.map} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/manifests.mjs +1 -1
- package/dist/orchestrator/index.d.mts +2 -2
- package/dist/orchestrator/index.mjs +2 -2
- package/dist/{orchestrator-DGp8rCN7.mjs → orchestrator-CW9zixuw.mjs} +58 -39
- package/dist/orchestrator-CW9zixuw.mjs.map +1 -0
- package/dist/standalone.mjs +56 -37
- package/dist/tokens/index.mjs +1 -1
- package/dist/{tokens-TXmurodq.mjs → tokens-BQ_augxi.mjs} +2 -2
- package/dist/{tokens-TXmurodq.mjs.map → tokens-BQ_augxi.mjs.map} +1 -1
- package/package.json +2 -16
- package/dist/atoms/index.d.ts +0 -9
- package/dist/atoms/index.d.ts.map +0 -1
- package/dist/atoms/zl-alert.d.ts +0 -56
- package/dist/atoms/zl-alert.d.ts.map +0 -1
- package/dist/atoms/zl-button.d.ts +0 -99
- package/dist/atoms/zl-button.d.ts.map +0 -1
- package/dist/atoms/zl-card.d.ts +0 -53
- package/dist/atoms/zl-card.d.ts.map +0 -1
- package/dist/atoms/zl-field.d.ts +0 -90
- package/dist/atoms/zl-field.d.ts.map +0 -1
- package/dist/atoms/zl-icon.d.ts +0 -48
- package/dist/atoms/zl-icon.d.ts.map +0 -1
- package/dist/atoms/zl-page-shell.d.ts +0 -48
- package/dist/atoms/zl-page-shell.d.ts.map +0 -1
- package/dist/atoms/zl-passkey.d.ts +0 -123
- package/dist/atoms/zl-passkey.d.ts.map +0 -1
- package/dist/atoms/zl-pill.d.ts +0 -54
- package/dist/atoms/zl-pill.d.ts.map +0 -1
- package/dist/atoms-Dh5J7QwT.mjs.map +0 -1
- package/dist/default-BG5uwuAm.mjs +0 -6
- package/dist/default-BG5uwuAm.mjs.map +0 -1
- package/dist/index-DQryonsO.d.mts.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/base64url.d.ts +0 -18
- package/dist/internal/base64url.d.ts.map +0 -1
- package/dist/internal/emit.d.ts +0 -12
- package/dist/internal/emit.d.ts.map +0 -1
- package/dist/internal/escape-html.d.ts +0 -10
- package/dist/internal/escape-html.d.ts.map +0 -1
- package/dist/internal/unique-id.d.ts +0 -2
- package/dist/internal/unique-id.d.ts.map +0 -1
- package/dist/manifest.d.ts +0 -36
- package/dist/manifest.d.ts.map +0 -1
- package/dist/manifests.d.ts +0 -6
- package/dist/manifests.d.ts.map +0 -1
- package/dist/orchestrator/api-client.d.ts +0 -33
- package/dist/orchestrator/api-client.d.ts.map +0 -1
- package/dist/orchestrator/branding-to-tokens.d.ts +0 -28
- package/dist/orchestrator/branding-to-tokens.d.ts.map +0 -1
- package/dist/orchestrator/branding-validator.d.ts +0 -7
- package/dist/orchestrator/branding-validator.d.ts.map +0 -1
- package/dist/orchestrator/branding.d.ts +0 -76
- package/dist/orchestrator/branding.d.ts.map +0 -1
- package/dist/orchestrator/font-loader.d.ts +0 -2
- package/dist/orchestrator/font-loader.d.ts.map +0 -1
- package/dist/orchestrator/index.d.ts +0 -23
- package/dist/orchestrator/index.d.ts.map +0 -1
- package/dist/orchestrator/liquid.d.ts +0 -31
- package/dist/orchestrator/liquid.d.ts.map +0 -1
- package/dist/orchestrator/locales/de.d.ts +0 -16
- package/dist/orchestrator/locales/de.d.ts.map +0 -1
- package/dist/orchestrator/locales/en.d.ts +0 -19
- package/dist/orchestrator/locales/en.d.ts.map +0 -1
- package/dist/orchestrator/locales/index.d.ts +0 -13
- package/dist/orchestrator/locales/index.d.ts.map +0 -1
- package/dist/orchestrator/locales/it.d.ts +0 -14
- package/dist/orchestrator/locales/it.d.ts.map +0 -1
- package/dist/orchestrator/mandatory-gates.d.ts +0 -26
- package/dist/orchestrator/mandatory-gates.d.ts.map +0 -1
- package/dist/orchestrator/resolve-api.d.ts +0 -37
- package/dist/orchestrator/resolve-api.d.ts.map +0 -1
- package/dist/orchestrator/sanitiser.d.ts +0 -6
- package/dist/orchestrator/sanitiser.d.ts.map +0 -1
- package/dist/orchestrator/template-context.d.ts +0 -55
- package/dist/orchestrator/template-context.d.ts.map +0 -1
- package/dist/orchestrator/template-names.d.ts +0 -16
- package/dist/orchestrator/template-names.d.ts.map +0 -1
- package/dist/orchestrator/theme-controller.d.ts +0 -30
- package/dist/orchestrator/theme-controller.d.ts.map +0 -1
- package/dist/orchestrator/zitadel-login.d.ts +0 -213
- package/dist/orchestrator/zitadel-login.d.ts.map +0 -1
- package/dist/orchestrator/zitadel-logout.d.ts +0 -114
- package/dist/orchestrator/zitadel-logout.d.ts.map +0 -1
- package/dist/orchestrator-DGp8rCN7.mjs.map +0 -1
- package/dist/styles/base.d.ts +0 -7
- package/dist/styles/base.d.ts.map +0 -1
- package/dist/styles/focus-ring.d.ts +0 -7
- package/dist/styles/focus-ring.d.ts.map +0 -1
- package/dist/styles/index.d.ts +0 -5
- package/dist/styles/index.d.ts.map +0 -1
- package/dist/styles/surface.d.ts +0 -8
- package/dist/styles/surface.d.ts.map +0 -1
- package/dist/styles/tokens.d.ts +0 -11
- package/dist/styles/tokens.d.ts.map +0 -1
- package/dist/tokens/index.d.ts +0 -9
- package/dist/tokens/index.d.ts.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { type ZitadelProject } from "@zitadel/api/config";
|
|
2
|
-
import type { CreateFlowBodyPurpose } from "@zitadel/api/generated/model";
|
|
3
|
-
import { LitElement, type PropertyValues } from "lit";
|
|
4
|
-
import "../atoms/index.js";
|
|
5
|
-
import { type Locale } from "./locales/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* `<zitadel-login>` — the auth-UI orchestrator.
|
|
8
|
-
*
|
|
9
|
-
* Drives the typed `@zitadel/api` Flow API directly: `POST /flow`
|
|
10
|
-
* starts a flow, `POST /flow/{id}/submit` advances it. Renders each step
|
|
11
|
-
* through LiquidJS, sanitises the output via DOMPurify, and mounts the
|
|
12
|
-
* result inside a real `<form>` element in its Shadow DOM via Lit's
|
|
13
|
-
* `unsafeHTML` directive. Atom CustomEvents (`zl-input` / `zl-submit`)
|
|
14
|
-
* and the form's native `submit` event feed back into the
|
|
15
|
-
* submit cycle.
|
|
16
|
-
*
|
|
17
|
-
* Form participation: the orchestrator owns the `<form>` so Enter submits,
|
|
18
|
-
* browsers offer "save password" prompts, and password managers / autofill
|
|
19
|
-
* see a real form. Each `<zl-field>` is form-associated (see
|
|
20
|
-
* `docs/design/branding/form-participation.md`) so its value participates in
|
|
21
|
-
* the form even though it lives inside its own shadow root. The shadow root
|
|
22
|
-
* also delegates focus, and after each step swap focus moves to the first
|
|
23
|
-
* field so screen-reader and keyboard users land in a sensible spot.
|
|
24
|
-
*
|
|
25
|
-
* Session/state: the server is stateless between requests — a `_zflow`
|
|
26
|
-
* HttpOnly cookie carries orchestration state. We always run with
|
|
27
|
-
* `credentials: "include"` (set in `api-client.ts`). The flow handle (`id`)
|
|
28
|
-
* may rotate on pivots/pops; we re-read it from every response.
|
|
29
|
-
*
|
|
30
|
-
* Spec sources:
|
|
31
|
-
* - `docs/design/flowengine/flow-engine-guide.md`
|
|
32
|
-
* - `docs/design/branding/templates.md`
|
|
33
|
-
* - `docs/design/branding/tokens.md`
|
|
34
|
-
* - `docs/design/branding/schema.md`
|
|
35
|
-
* - `docs/design/branding/form-participation.md`
|
|
36
|
-
* - `docs/design/flowengine/template-security.md`
|
|
37
|
-
*/
|
|
38
|
-
export declare class ZitadelLogin extends LitElement {
|
|
39
|
-
static shadowRootOptions: ShadowRootInit;
|
|
40
|
-
static styles: import("lit").CSSResult;
|
|
41
|
-
accessor purpose: CreateFlowBodyPurpose;
|
|
42
|
-
/**
|
|
43
|
-
* SDK project handle returned by `configureZitadel()`. Set from JS (or a
|
|
44
|
-
* framework binding). When set, takes precedence over both the
|
|
45
|
-
* `project-id`/`proxy-path`/`url` attributes and the global singleton from
|
|
46
|
-
* `getZitadelConfig()`.
|
|
47
|
-
*/
|
|
48
|
-
accessor project: ZitadelProject | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Project ID, set declaratively in HTML. Lets the component be configured on
|
|
51
|
-
* a plain page without JS or `configureZitadel()`. Ignored when the `project`
|
|
52
|
-
* property or a `configureZitadel()` global is set. See {@link projectAttrs}.
|
|
53
|
-
*/
|
|
54
|
-
accessor projectId: string;
|
|
55
|
-
/**
|
|
56
|
-
* Proxy path for API requests (e.g. `/__nextgen`), set declaratively in HTML.
|
|
57
|
-
* Defaults to `/__nextgen` when omitted, matching `configureZitadel()`.
|
|
58
|
-
*/
|
|
59
|
-
accessor proxyPath: string;
|
|
60
|
-
/**
|
|
61
|
-
* Full URL of the Zitadel auth backend, set declaratively in HTML. Optional —
|
|
62
|
-
* not needed in client-only setups.
|
|
63
|
-
*/
|
|
64
|
-
accessor url: string;
|
|
65
|
-
/**
|
|
66
|
-
* URL to navigate to after a successful embedded sign-in. When set, the
|
|
67
|
-
* orchestrator exchanges the terminal `handoff_token` via the generated
|
|
68
|
-
* API client (setting the session cookie) and then performs a full
|
|
69
|
-
* navigation to this URL so host middleware can observe the cookie.
|
|
70
|
-
* For `complete: "redirect"` the orchestrator follows `redirect_uri`
|
|
71
|
-
* instead and does not run the exchange.
|
|
72
|
-
*/
|
|
73
|
-
accessor postSignInUrl: string;
|
|
74
|
-
/**
|
|
75
|
-
* Existing flow handle to resume rather than start a new flow. When set,
|
|
76
|
-
* the orchestrator hits `GET /flow/{id}` instead of `POST /flow` on
|
|
77
|
-
* mount, so a page reload after a network blip can re-render the same
|
|
78
|
-
* step without losing collected state.
|
|
79
|
-
*/
|
|
80
|
-
accessor resumeFlowId: string;
|
|
81
|
-
/**
|
|
82
|
-
* BCP 47 language tag (e.g. `"de"`, `"en-US"`). The widget resolves this
|
|
83
|
-
* to a built-in locale dictionary. Falls back to auto-detection from
|
|
84
|
-
* `document.documentElement.lang` or `navigator.language` when empty.
|
|
85
|
-
*/
|
|
86
|
-
accessor lang: string;
|
|
87
|
-
/**
|
|
88
|
-
* Custom locale dictionaries keyed by language code. When set, these take
|
|
89
|
-
* precedence over the built-in dictionaries for matching language codes.
|
|
90
|
-
*
|
|
91
|
-
* ```ts
|
|
92
|
-
* import { en } from "@zitadel/components";
|
|
93
|
-
* const locales = {
|
|
94
|
-
* en: { ...en, "identifier.title": "Welcome" },
|
|
95
|
-
* de: myGermanDict,
|
|
96
|
-
* };
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
accessor locales: Record<string, Locale> | undefined;
|
|
100
|
-
private accessor response;
|
|
101
|
-
private accessor branding;
|
|
102
|
-
private accessor loading;
|
|
103
|
-
private accessor startupError;
|
|
104
|
-
private accessor formValues;
|
|
105
|
-
private readonly themeController;
|
|
106
|
-
private engine;
|
|
107
|
-
private readonly sanitise;
|
|
108
|
-
/**
|
|
109
|
-
* Cached compiled tenant template, keyed by source string. Re-rendering on
|
|
110
|
-
* every `formValues` change otherwise re-parses the same template.
|
|
111
|
-
*/
|
|
112
|
-
private tenantTemplateCache;
|
|
113
|
-
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
114
|
-
/**
|
|
115
|
-
* Start the flow after the first render rather than in `connectedCallback`.
|
|
116
|
-
* Frameworks that wrap web components (e.g. `@lit/react` in the console)
|
|
117
|
-
* attach the element first and then assign object properties (`branding`,
|
|
118
|
-
* `locale`) via setters. `connectedCallback` runs synchronously on attach
|
|
119
|
-
* — before any setters from a wrapper's effects/refs — so reading those
|
|
120
|
-
* properties there sees stale defaults. `firstUpdated` runs after Lit's
|
|
121
|
-
* first render, by which time setters from the wrapping framework have
|
|
122
|
-
* fired.
|
|
123
|
-
*/
|
|
124
|
-
protected firstUpdated(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Resolves the effective locale dictionary. The built-in dictionary for the
|
|
127
|
-
* resolved language is used as the base; entries from the `locales` map (if
|
|
128
|
-
* set) are spread on top so partial overrides work without importing and
|
|
129
|
-
* spreading the full base dictionary.
|
|
130
|
-
*
|
|
131
|
-
* Priority: explicit `lang` attr → `navigator.language` (user preference)
|
|
132
|
-
* → `document.documentElement.lang` (page default) → English fallback.
|
|
133
|
-
*/
|
|
134
|
-
private resolveLocale;
|
|
135
|
-
willUpdate(changed: PropertyValues<this>): void;
|
|
136
|
-
updated(changed: PropertyValues<this>): void;
|
|
137
|
-
private hydrateStepAfterRender;
|
|
138
|
-
render(): import("lit").TemplateResult<1>;
|
|
139
|
-
/**
|
|
140
|
-
* Inject the attribution badge into the rendered template's
|
|
141
|
-
* `<zl-page-shell>` footer slot. The attribution must live INSIDE the
|
|
142
|
-
* page-shell so it sits within the 100vh viewport rhythm (matching the
|
|
143
|
-
* Figma sign-in frame where the pill sits 24px below the card, both
|
|
144
|
-
* centred on the page). It can't be a sibling of the page-shell because
|
|
145
|
-
* the page-shell already occupies the full viewport height.
|
|
146
|
-
*
|
|
147
|
-
* This markup is appended AFTER `renderStep` has sanitised the Liquid
|
|
148
|
-
* output, so it is not run through DOMPurify. It is orchestrator-owned and
|
|
149
|
-
* any tenant-supplied values (`custom_link`) are escaped via `escapeHtml`.
|
|
150
|
-
*/
|
|
151
|
-
private injectAttribution;
|
|
152
|
-
/**
|
|
153
|
-
* "Secured with Zitadel" attribution chrome injected into every
|
|
154
|
-
* template's page-shell footer slot. Controlled by
|
|
155
|
-
* `branding.attribution.show_zitadel` — defaults to `true` for
|
|
156
|
-
* community / OSS deployments. Licensed tenants can suppress the badge
|
|
157
|
-
* entirely or swap it for a `custom_link` value.
|
|
158
|
-
*/
|
|
159
|
-
private renderAttributionHtml;
|
|
160
|
-
/** Declarative config read from this element's attributes. */
|
|
161
|
-
private get projectAttrs();
|
|
162
|
-
private startFlow;
|
|
163
|
-
private applyResponse;
|
|
164
|
-
private maybeCompleteFlow;
|
|
165
|
-
private renderStep;
|
|
166
|
-
/**
|
|
167
|
-
* Build a `FlowIdentity` from the orchestrator's captured form values so
|
|
168
|
-
* the signed-in template can greet the user by email without the API
|
|
169
|
-
* having to round-trip identity claims. Email comes from the
|
|
170
|
-
* identifier step; display name composes from `given_name` /
|
|
171
|
-
* `family_name` when the register step ran.
|
|
172
|
-
*/
|
|
173
|
-
private deriveIdentity;
|
|
174
|
-
private applyValuesToFields;
|
|
175
|
-
private captureValuesFromFields;
|
|
176
|
-
private currentFieldValue;
|
|
177
|
-
private handleAtomInput;
|
|
178
|
-
private syncFieldElementValue;
|
|
179
|
-
private handleAtomSubmit;
|
|
180
|
-
/** Secondary navigation rows (`data-action` on `.zl-card-nav__link`). */
|
|
181
|
-
private handleDelegatedAction;
|
|
182
|
-
private handleFormSubmit;
|
|
183
|
-
/**
|
|
184
|
-
* Handle a successful WebAuthn ceremony. Auto-submit with the proof
|
|
185
|
-
* as `challenge_response` so the flow advances without extra user
|
|
186
|
-
* interaction — the ceremony IS the factor verification (ADR 013).
|
|
187
|
-
*/
|
|
188
|
-
private handlePasskeyResult;
|
|
189
|
-
/**
|
|
190
|
-
* Handle a WebAuthn ceremony error. Re-render the current step with
|
|
191
|
-
* an error message so the user sees feedback and can retry or skip.
|
|
192
|
-
*
|
|
193
|
-
* Guard: if the step already carries the same error key, skip the update.
|
|
194
|
-
* Mutating `this.response` triggers `unsafeHTML` to replace the DOM tree,
|
|
195
|
-
* which reconnects a fresh `<zl-passkey>` that immediately re-starts the
|
|
196
|
-
* ceremony — creating an infinite loop. The guard breaks the cycle.
|
|
197
|
-
*
|
|
198
|
-
* We also strip the `challenge` from the step so the template does not
|
|
199
|
-
* render a new `<zl-passkey>` on re-render. Without this, the first
|
|
200
|
-
* cancel would trigger a second ceremony (the guard prevents a third).
|
|
201
|
-
*/
|
|
202
|
-
private handlePasskeyError;
|
|
203
|
-
private findPrimaryAction;
|
|
204
|
-
private moveFocusToFirstField;
|
|
205
|
-
private submit;
|
|
206
|
-
private handleTransportError;
|
|
207
|
-
}
|
|
208
|
-
declare global {
|
|
209
|
-
interface HTMLElementTagNameMap {
|
|
210
|
-
"zitadel-login": ZitadelLogin;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
//# sourceMappingURL=zitadel-login.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zitadel-login.d.ts","sourceRoot":"","sources":["../../src/orchestrator/zitadel-login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAGV,qBAAqB,EAGtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAa,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKjE,OAAO,mBAAmB,CAAC;AAgB3B,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAQrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,YAAa,SAAQ,UAAU;IAC1C,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAOF,OAAgB,MAAM,0BAMpB;IAE0B,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAW;IAE9E;;;;;OAKG;IAC6B,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAC;IAE7E;;;;OAIG;IACkD,QAAQ,CAAC,SAAS,SAAM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A4BvB,OAAO,CAAC,aAAa;YA0BP,iBAAiB;IAoC/B,OAAO,CAAC,UAAU;IAuDlB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,uBAAuB;IAyB/B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,eAAe,CAOrB;IAEF,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,gBAAgB,CAGtB;IAEF,yEAAyE;IACzE,OAAO,CAAC,qBAAqB,CAO3B;IAEF,OAAO,CAAC,gBAAgB,CAatB;IAEF;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAUzB;IAEF;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,kBAAkB,CAexB;IAEF,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,qBAAqB;YAQf,MAAM;IAqCpB,OAAO,CAAC,oBAAoB;CAO7B;AAWD,OAAO,CAAC,MAAM,CAAC,CAAC;IACd,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { LitElement, nothing } from "lit";
|
|
2
|
-
import { type ZitadelProject } from "@zitadel/api/config";
|
|
3
|
-
/**
|
|
4
|
-
* `<zitadel-logout>` — orchestrator-tier element that lets the signed-in user
|
|
5
|
-
* sign out without touching the flow API.
|
|
6
|
-
*
|
|
7
|
-
* Reads the user's display name + email from the `__nextgen_display` cookie
|
|
8
|
-
* (set by the auth backend on sign-in), renders an avatar trigger with a
|
|
9
|
-
* dropdown that exposes a "Sign out" action, and calls the typed
|
|
10
|
-
* `revokeMySession` operation in `@zitadel/api`
|
|
11
|
-
* (`DELETE /sessions/me`). The server clears the session cookie via
|
|
12
|
-
* `Set-Cookie: Max-Age=0`; on success the element fires `zitadel-signout`
|
|
13
|
-
* and optionally navigates to `post-sign-out-url`. (`getEndSessionUrl()`
|
|
14
|
-
* additionally exposes the OIDC end-session URL for consumers that prefer a
|
|
15
|
-
* user-agent-driven redirect.)
|
|
16
|
-
*
|
|
17
|
-
* ## Template-slot mode
|
|
18
|
-
*
|
|
19
|
-
* When the consumer projects a `<template>` child the element renders the
|
|
20
|
-
* template's clone into its light DOM with `{{name}}`, `{{email}}`, and
|
|
21
|
-
* `{{initial}}` substituted. Any element with `data-action="logout"` inside
|
|
22
|
-
* the cloned template triggers the sign-out flow. This mirrors the
|
|
23
|
-
* placeholder `<nextgen-logout>`'s contract so existing markup keeps working.
|
|
24
|
-
*
|
|
25
|
-
* Default styles consume the `--zl-*` design tokens so tenant branding
|
|
26
|
-
* applies automatically — there is no hardcoded brand colour, radius, or
|
|
27
|
-
* shadow.
|
|
28
|
-
*/
|
|
29
|
-
export declare class ZitadelLogout extends LitElement {
|
|
30
|
-
static styles: import("lit").CSSResult[];
|
|
31
|
-
/**
|
|
32
|
-
* SDK project handle returned by `configureZitadel()`. Set from JS (or a
|
|
33
|
-
* framework binding). When set, takes precedence over both the
|
|
34
|
-
* `project-id`/`proxy-path`/`url` attributes and the global singleton from
|
|
35
|
-
* `getZitadelConfig()`.
|
|
36
|
-
*/
|
|
37
|
-
accessor project: ZitadelProject | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Project ID, set declaratively in HTML. Lets the component be configured on
|
|
40
|
-
* a plain page without JS or `configureZitadel()`. Ignored when the `project`
|
|
41
|
-
* property or a `configureZitadel()` global is set.
|
|
42
|
-
*/
|
|
43
|
-
accessor projectId: string;
|
|
44
|
-
/**
|
|
45
|
-
* Proxy path for API requests (e.g. `/__nextgen`), set declaratively in HTML.
|
|
46
|
-
* Defaults to `/__nextgen` when omitted, matching `configureZitadel()`.
|
|
47
|
-
*/
|
|
48
|
-
accessor proxyPath: string;
|
|
49
|
-
/**
|
|
50
|
-
* Full URL of the Zitadel auth backend, set declaratively in HTML. Optional —
|
|
51
|
-
* not needed in client-only setups.
|
|
52
|
-
*/
|
|
53
|
-
accessor url: string;
|
|
54
|
-
/** URL to navigate to after a successful sign-out. */
|
|
55
|
-
accessor postSignOutUrl: string;
|
|
56
|
-
/**
|
|
57
|
-
* OIDC `client_id` to forward as a query parameter on the end-session
|
|
58
|
-
* request, mirroring the standard end-session contract. Optional —
|
|
59
|
-
* leaving this empty is fine when the backend can resolve the client
|
|
60
|
-
* from the session cookie alone.
|
|
61
|
-
*/
|
|
62
|
-
accessor clientId: string;
|
|
63
|
-
private accessor displayName;
|
|
64
|
-
private accessor displayEmail;
|
|
65
|
-
private accessor open;
|
|
66
|
-
private accessor loading;
|
|
67
|
-
private accessor errorMessage;
|
|
68
|
-
private templateMode;
|
|
69
|
-
connectedCallback(): void;
|
|
70
|
-
disconnectedCallback(): void;
|
|
71
|
-
updated(): void;
|
|
72
|
-
/**
|
|
73
|
-
* Decodes the `__nextgen_display` cookie (base64-encoded JSON, set by the
|
|
74
|
-
* auth backend on sign-in) and populates `displayName` / `displayEmail`.
|
|
75
|
-
* A missing or malformed cookie is intentionally non-fatal — the dropdown
|
|
76
|
-
* still renders, just with empty values.
|
|
77
|
-
*/
|
|
78
|
-
private readDisplayCookie;
|
|
79
|
-
private get initial();
|
|
80
|
-
/**
|
|
81
|
-
* Clones a consumer-supplied `<template>` into the light DOM, fills the
|
|
82
|
-
* `{{name}}`, `{{email}}`, and `{{initial}}` tokens via a TreeWalker, and
|
|
83
|
-
* wires every element with `data-action="logout"` to trigger sign-out.
|
|
84
|
-
* Light-DOM mounting is deliberate so the consumer's existing CSS applies.
|
|
85
|
-
*/
|
|
86
|
-
private renderTemplate;
|
|
87
|
-
private readonly handleDocumentClick;
|
|
88
|
-
private readonly handleDocumentKeydown;
|
|
89
|
-
private toggleOpen;
|
|
90
|
-
/**
|
|
91
|
-
* Calls `DELETE /sessions/me` (`revokeMySession`) with `credentials: "include"`.
|
|
92
|
-
* The server validates the `__nextgen_session` cookie, deletes the session, and
|
|
93
|
-
* clears the cookie via `Set-Cookie: Max-Age=0`. On success this element fires
|
|
94
|
-
* `zitadel-signout` and optionally navigates to `postSignOutUrl`.
|
|
95
|
-
*/
|
|
96
|
-
/** Declarative config read from this element's attributes. */
|
|
97
|
-
private get projectAttrs();
|
|
98
|
-
private doLogout;
|
|
99
|
-
/**
|
|
100
|
-
* Returns the absolute URL the end-session request will hit. Useful for
|
|
101
|
-
* test assertions and for consumers that prefer to navigate the browser
|
|
102
|
-
* directly (instead of fetching) so the OIDC session-end redirect is
|
|
103
|
-
* driven by the user agent.
|
|
104
|
-
*/
|
|
105
|
-
getEndSessionUrl(): string;
|
|
106
|
-
private handleSignOutClick;
|
|
107
|
-
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
108
|
-
}
|
|
109
|
-
declare global {
|
|
110
|
-
interface HTMLElementTagNameMap {
|
|
111
|
-
"zitadel-logout": ZitadelLogout;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=zitadel-logout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zitadel-logout.d.ts","sourceRoot":"","sources":["../../src/orchestrator/zitadel-logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAoB1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,OAAgB,MAAM,4BA2IpB;IAEF;;;;;OAKG;IAC6B,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAC;IAE7E;;;;OAIG;IACkD,QAAQ,CAAC,SAAS,SAAM;IAE7E;;;OAGG;IACkD,QAAQ,CAAC,SAAS,SAAM;IAE7E;;;OAGG;IACyB,QAAQ,CAAC,GAAG,SAAM;IAE9C,sDAAsD;IACM,QAAQ,CAAC,cAAc,SAAM;IAEzF;;;;;OAKG;IACiD,QAAQ,CAAC,QAAQ,SAAM;IAElE,OAAO,CAA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