@hanzo/ui 8.30.4 → 8.32.0
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/dist/auth/SignInPanel.cjs +49 -0
- package/dist/auth/SignInPanel.d.ts +38 -0
- package/dist/auth/SignInPanel.d.ts.map +1 -0
- package/dist/auth/SignInPanel.js +47 -0
- package/dist/auth/SignInPanel.js.map +1 -0
- package/dist/auth/handoff.cjs +56 -0
- package/dist/auth/handoff.d.ts +50 -0
- package/dist/auth/handoff.d.ts.map +1 -0
- package/dist/auth/handoff.js +52 -0
- package/dist/auth/handoff.js.map +1 -0
- package/dist/auth/index.cjs +7 -1
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/signout.cjs +23 -5
- package/dist/auth/signout.d.ts +23 -2
- package/dist/auth/signout.d.ts.map +1 -1
- package/dist/auth/signout.js +22 -5
- package/dist/auth/signout.js.map +1 -1
- package/dist/backends/gui/dialog.cjs +1 -1
- package/dist/backends/gui/dialog.js +1 -1
- package/dist/backends/gui/dialog.js.map +1 -1
- package/dist/gallery.html +1 -1
- package/dist/product/BusinessHeader.cjs +347 -0
- package/dist/product/BusinessHeader.d.ts +113 -0
- package/dist/product/BusinessHeader.d.ts.map +1 -0
- package/dist/product/BusinessHeader.js +343 -0
- package/dist/product/BusinessHeader.js.map +1 -0
- package/dist/product/index.cjs +1 -0
- package/dist/product/index.d.ts +1 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +1 -0
- package/dist/product/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SignInPanel = SignInPanel;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_2 = require("@hanzo/i18n/react");
|
|
8
|
+
const react_3 = require("@hanzo/iam/react");
|
|
9
|
+
const react_simple_icons_1 = require("@icons-pack/react-simple-icons");
|
|
10
|
+
const button_1 = require("../backends/gui/button.cjs");
|
|
11
|
+
const field_1 = require("../backends/gui/field.cjs");
|
|
12
|
+
const input_1 = require("../backends/gui/input.cjs");
|
|
13
|
+
const layout_1 = require("../backends/gui/layout.cjs");
|
|
14
|
+
const handoff_1 = require("./handoff.cjs");
|
|
15
|
+
const NAME = { google: 'Google', github: 'GitHub' };
|
|
16
|
+
function SignInPanel({ title, line, providers = ['google', 'github'], signin = handoff_1.SIGNIN, signup = true, termsHref = 'https://hanzo.ai/terms', privacyHref = 'https://hanzo.ai/privacy', authorize = (u) => u, track, }) {
|
|
17
|
+
const { t } = (0, react_2.useI18n)();
|
|
18
|
+
const { sdk } = (0, react_3.useIam)();
|
|
19
|
+
const [email, setEmail] = (0, react_1.useState)('');
|
|
20
|
+
const [busy, setBusy] = (0, react_1.useState)(null);
|
|
21
|
+
const [wrong, setWrong] = (0, react_1.useState)(null);
|
|
22
|
+
/** Mint this site's own request, then leave for where `way` goes. */
|
|
23
|
+
async function leave(method, way, hint) {
|
|
24
|
+
setWrong(null);
|
|
25
|
+
setBusy(method);
|
|
26
|
+
track?.('signin_started', { method });
|
|
27
|
+
try {
|
|
28
|
+
const request = await sdk.getSigninUrl(hint ? { additionalParams: { login_hint: hint } } : undefined);
|
|
29
|
+
window.location.assign(authorize((0, handoff_1.handoff)(request, way, signin)));
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
setWrong(err instanceof Error && err.message ? err.message : 'Signing in could not start. Try again.');
|
|
33
|
+
setBusy(null);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function withEmail(e) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
const typed = (0, handoff_1.address)(email);
|
|
39
|
+
if (!typed) {
|
|
40
|
+
setWrong('Enter your email address.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
void leave('email', { kind: 'email', email: typed }, typed);
|
|
44
|
+
}
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(layout_1.YStack, { width: "100%", maxW: 400, items: "center", gap: "$4", children: [title ? ((0, jsx_runtime_1.jsx)(layout_1.Heading, { render: "h1", size: "$8", fontWeight: "500", color: "$ink", m: 0, text: "center", children: title })) : null, line ? ((0, jsx_runtime_1.jsx)(layout_1.Paragraph, { size: "$3", color: "$quiet", m: 0, text: "center", maxW: 360, children: line })) : null, (0, jsx_runtime_1.jsx)(layout_1.YStack, { width: "100%", gap: "$2.5", mt: title || line ? '$2' : 0, children: providers.map((p) => ((0, jsx_runtime_1.jsxs)(button_1.Button, { type: "button", variant: "secondary", size: "lg", rounded: "$10", width: "100%", disabled: busy !== null, onClick: () => void leave(p, { kind: 'provider', provider: p }), children: [p === 'google' ? (0, jsx_runtime_1.jsx)(react_simple_icons_1.SiGoogle, { size: 16 }) : (0, jsx_runtime_1.jsx)(react_simple_icons_1.SiGithub, { size: 16 }), t('Continue with {provider}', { provider: NAME[p] })] }, p))) }), providers.length ? ((0, jsx_runtime_1.jsx)(layout_1.YStack, { width: "100%", children: (0, jsx_runtime_1.jsx)(field_1.FieldSeparator, { children: t('or') }) })) : null, (0, jsx_runtime_1.jsxs)(layout_1.YStack, { render: (0, jsx_runtime_1.jsx)("form", { onSubmit: withEmail, noValidate: true }), width: "100%", gap: "$3", children: [(0, jsx_runtime_1.jsx)(field_1.Field, { gap: "$2", children: (0, jsx_runtime_1.jsx)(input_1.Input, { id: "hanzo-signin-email", type: "email", name: "email", autoComplete: "username", "aria-label": t('Email'), value: email, onChangeText: setEmail, placeholder: "you@company.com" }) }), wrong ? (0, jsx_runtime_1.jsx)(field_1.FieldError, { children: t(wrong) }) : null, (0, jsx_runtime_1.jsx)(button_1.Button, { type: "submit", size: "lg", rounded: "$10", width: "100%", bg: "$ink", color: "$background", borderColor: "$ink", hoverStyle: { opacity: 0.92 }, disabled: busy !== null, children: t('Continue with email') })] }), signup ? ((0, jsx_runtime_1.jsxs)(layout_1.Paragraph, { size: "$2", color: "$quiet", m: 0, children: [`${t('New to Hanzo?')} `, (0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", variant: "link", size: "sm", px: 0, height: "auto", disabled: busy !== null, onClick: () => void leave('signup', { kind: 'signup' }), children: t('Create account') })] })) : null, (0, jsx_runtime_1.jsx)(layout_1.Paragraph, { size: "$1", color: "$quiet", m: 0, text: "center", maxW: 400, children: t("By continuing, you agree to Hanzo's {terms} and {privacy}.", {
|
|
46
|
+
terms: ((0, jsx_runtime_1.jsx)(layout_1.Anchor, { href: termsHref, color: "$ink", textDecorationLine: "underline", children: t('Terms') })),
|
|
47
|
+
privacy: ((0, jsx_runtime_1.jsx)(layout_1.Anchor, { href: privacyHref, color: "$ink", textDecorationLine: "underline", children: t('Privacy Policy') })),
|
|
48
|
+
}) })] }));
|
|
49
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ProviderKind } from './handoff.js';
|
|
3
|
+
/**
|
|
4
|
+
* The sign-in a Hanzo site draws on its own front page (hanzo.app, hanzo.bot,
|
|
5
|
+
* hanzo.team), shared so every site asks the same way and leaves the same way.
|
|
6
|
+
*
|
|
7
|
+
* It looks like a sign-in and is a door: no credential is typed here, and no
|
|
8
|
+
* session is made on this origin. Each press mints this site's own authorize
|
|
9
|
+
* request (`getSigninUrl`, which keeps the PKCE verifier and state here) and
|
|
10
|
+
* leaves with it (./handoff.ts): Google or GitHub straight to the provider, in one
|
|
11
|
+
* press; an email to hanzo.ai/login with the address filled in; a new account to
|
|
12
|
+
* hanzo.ai/signup. The session that answers is hanzo.ai's, so a person signed in
|
|
13
|
+
* on any Hanzo site is not asked again.
|
|
14
|
+
*
|
|
15
|
+
* Drawn from @hanzo/ui components in the theme's tokens; the host mounts its
|
|
16
|
+
* GuiProvider and imports no stylesheet. Framework-free: a Next export and a Vite
|
|
17
|
+
* app draw it alike.
|
|
18
|
+
*/
|
|
19
|
+
export interface SignInPanelProps {
|
|
20
|
+
/** The headline: `Sign in to Hanzo Team`. Omit to draw the panel alone under the host's own. */
|
|
21
|
+
title?: ReactNode;
|
|
22
|
+
/** One line under the headline. */
|
|
23
|
+
line?: ReactNode;
|
|
24
|
+
/** The providers offered, in order. Default Google, then GitHub. */
|
|
25
|
+
providers?: ProviderKind[];
|
|
26
|
+
/** The origin people sign in on. Default https://hanzo.ai. */
|
|
27
|
+
signin?: string;
|
|
28
|
+
/** Offer "Create account". Default true. */
|
|
29
|
+
signup?: boolean;
|
|
30
|
+
termsHref?: string;
|
|
31
|
+
privacyHref?: string;
|
|
32
|
+
/** Decorates an address the browser is about to leave for (the visitor rides along). */
|
|
33
|
+
authorize?: (url: string) => string;
|
|
34
|
+
/** A press the stream should hear: `signin_started{method}`. */
|
|
35
|
+
track?: (name: string, props?: Record<string, unknown>) => void;
|
|
36
|
+
}
|
|
37
|
+
export declare function SignInPanel({ title, line, providers, signin, signup, termsHref, privacyHref, authorize, track, }: SignInPanelProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=SignInPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignInPanel.d.ts","sourceRoot":"","sources":["../../src/auth/SignInPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAQhE,OAAO,EAA4B,KAAK,YAAY,EAAY,MAAM,WAAW,CAAA;AAEjF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gGAAgG;IAChG,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,mCAAmC;IACnC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,oEAAoE;IACpE,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;IAC1B,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wFAAwF;IACxF,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,gEAAgE;IAChE,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;CAChE;AAID,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,SAAgC,EAChC,MAAe,EACf,MAAa,EACb,SAAoC,EACpC,WAAwC,EACxC,SAAoB,EACpB,KAAK,GACN,EAAE,gBAAgB,+BAkGlB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
5
|
+
import { useIam } from '@hanzo/iam/react';
|
|
6
|
+
import { SiGithub, SiGoogle } from '@icons-pack/react-simple-icons';
|
|
7
|
+
import { Button } from '../backends/gui/button.js';
|
|
8
|
+
import { Field, FieldError, FieldSeparator } from '../backends/gui/field.js';
|
|
9
|
+
import { Input } from '../backends/gui/input.js';
|
|
10
|
+
import { Anchor, Heading, Paragraph, YStack } from '../backends/gui/layout.js';
|
|
11
|
+
import { address, handoff, SIGNIN } from './handoff.js';
|
|
12
|
+
const NAME = { google: 'Google', github: 'GitHub' };
|
|
13
|
+
export function SignInPanel({ title, line, providers = ['google', 'github'], signin = SIGNIN, signup = true, termsHref = 'https://hanzo.ai/terms', privacyHref = 'https://hanzo.ai/privacy', authorize = (u) => u, track, }) {
|
|
14
|
+
const { t } = useI18n();
|
|
15
|
+
const { sdk } = useIam();
|
|
16
|
+
const [email, setEmail] = useState('');
|
|
17
|
+
const [busy, setBusy] = useState(null);
|
|
18
|
+
const [wrong, setWrong] = useState(null);
|
|
19
|
+
/** Mint this site's own request, then leave for where `way` goes. */
|
|
20
|
+
async function leave(method, way, hint) {
|
|
21
|
+
setWrong(null);
|
|
22
|
+
setBusy(method);
|
|
23
|
+
track?.('signin_started', { method });
|
|
24
|
+
try {
|
|
25
|
+
const request = await sdk.getSigninUrl(hint ? { additionalParams: { login_hint: hint } } : undefined);
|
|
26
|
+
window.location.assign(authorize(handoff(request, way, signin)));
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
setWrong(err instanceof Error && err.message ? err.message : 'Signing in could not start. Try again.');
|
|
30
|
+
setBusy(null);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function withEmail(e) {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
const typed = address(email);
|
|
36
|
+
if (!typed) {
|
|
37
|
+
setWrong('Enter your email address.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
void leave('email', { kind: 'email', email: typed }, typed);
|
|
41
|
+
}
|
|
42
|
+
return (_jsxs(YStack, { width: "100%", maxW: 400, items: "center", gap: "$4", children: [title ? (_jsx(Heading, { render: "h1", size: "$8", fontWeight: "500", color: "$ink", m: 0, text: "center", children: title })) : null, line ? (_jsx(Paragraph, { size: "$3", color: "$quiet", m: 0, text: "center", maxW: 360, children: line })) : null, _jsx(YStack, { width: "100%", gap: "$2.5", mt: title || line ? '$2' : 0, children: providers.map((p) => (_jsxs(Button, { type: "button", variant: "secondary", size: "lg", rounded: "$10", width: "100%", disabled: busy !== null, onClick: () => void leave(p, { kind: 'provider', provider: p }), children: [p === 'google' ? _jsx(SiGoogle, { size: 16 }) : _jsx(SiGithub, { size: 16 }), t('Continue with {provider}', { provider: NAME[p] })] }, p))) }), providers.length ? (_jsx(YStack, { width: "100%", children: _jsx(FieldSeparator, { children: t('or') }) })) : null, _jsxs(YStack, { render: _jsx("form", { onSubmit: withEmail, noValidate: true }), width: "100%", gap: "$3", children: [_jsx(Field, { gap: "$2", children: _jsx(Input, { id: "hanzo-signin-email", type: "email", name: "email", autoComplete: "username", "aria-label": t('Email'), value: email, onChangeText: setEmail, placeholder: "you@company.com" }) }), wrong ? _jsx(FieldError, { children: t(wrong) }) : null, _jsx(Button, { type: "submit", size: "lg", rounded: "$10", width: "100%", bg: "$ink", color: "$background", borderColor: "$ink", hoverStyle: { opacity: 0.92 }, disabled: busy !== null, children: t('Continue with email') })] }), signup ? (_jsxs(Paragraph, { size: "$2", color: "$quiet", m: 0, children: [`${t('New to Hanzo?')} `, _jsx(Button, { type: "button", variant: "link", size: "sm", px: 0, height: "auto", disabled: busy !== null, onClick: () => void leave('signup', { kind: 'signup' }), children: t('Create account') })] })) : null, _jsx(Paragraph, { size: "$1", color: "$quiet", m: 0, text: "center", maxW: 400, children: t("By continuing, you agree to Hanzo's {terms} and {privacy}.", {
|
|
43
|
+
terms: (_jsx(Anchor, { href: termsHref, color: "$ink", textDecorationLine: "underline", children: t('Terms') })),
|
|
44
|
+
privacy: (_jsx(Anchor, { href: privacyHref, color: "$ink", textDecorationLine: "underline", children: t('Privacy Policy') })),
|
|
45
|
+
}) })] }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=SignInPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignInPanel.js","sourceRoot":"","sources":["../../src/auth/SignInPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAkC,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,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C,YACjJ,CAAC,CAAC,gBAAgB,CAAC,GACb,IACC,CACb,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,SAAS,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,QAAQ,EAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,GAAG,YAC9D,CAAC,CAAC,4DAA4D,EAAE;oBAC/D,KAAK,EAAE,CACL,KAAC,MAAM,IAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAC,MAAM,EAAC,kBAAkB,EAAC,WAAW,YACjE,CAAC,CAAC,OAAO,CAAC,GACJ,CACV;oBACD,OAAO,EAAE,CACP,KAAC,MAAM,IAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,MAAM,EAAC,kBAAkB,EAAC,WAAW,YACnE,CAAC,CAAC,gBAAgB,CAAC,GACb,CACV;iBACF,CAAC,GACQ,IACL,CACV,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Where a Hanzo site sends somebody to sign in: hanzo.ai, never its own page.
|
|
4
|
+
*
|
|
5
|
+
* One IAM, and one origin every Hanzo site signs in on, so the session that
|
|
6
|
+
* answers every site lives on hanzo.ai. Each site is still its own OAuth client:
|
|
7
|
+
* it mints its own authorize request (its client, its callback, a fresh state and
|
|
8
|
+
* a PKCE challenge whose verifier stays in its own storage) with `getSigninUrl`,
|
|
9
|
+
* and hands hanzo.ai only the query. hanzo.ai answers it and IAM returns the code
|
|
10
|
+
* to the site's callback, where the site redeems it.
|
|
11
|
+
*
|
|
12
|
+
* a provider straight to IAM's authorize ON hanzo.ai with `provider`, which
|
|
13
|
+
* sends the browser to Google or GitHub at once (one press) and
|
|
14
|
+
* takes the provider's return on hanzo.ai, so the session lands
|
|
15
|
+
* there. Not the issuer's authorize: a provider hop that starts
|
|
16
|
+
* on hanzo.id returns to hanzo.id and leaves hanzo.ai signed out.
|
|
17
|
+
* an email hanzo.ai/login with `login_hint`, where the password or the
|
|
18
|
+
* code is typed.
|
|
19
|
+
* a new account hanzo.ai/signup.
|
|
20
|
+
*
|
|
21
|
+
* Pure, so every address is tested without a browser.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.SIGNIN = void 0;
|
|
25
|
+
exports.handoff = handoff;
|
|
26
|
+
exports.address = address;
|
|
27
|
+
/** The one origin Hanzo signs people in on. */
|
|
28
|
+
exports.SIGNIN = 'https://hanzo.ai';
|
|
29
|
+
/**
|
|
30
|
+
* The address a press leaves for, from the site's own authorize request
|
|
31
|
+
* (`request`, as `getSigninUrl` answered it). Only its query travels.
|
|
32
|
+
*/
|
|
33
|
+
function handoff(request, way, signin = exports.SIGNIN) {
|
|
34
|
+
const q = new URL(request).searchParams;
|
|
35
|
+
const at = signin.replace(/\/+$/, '');
|
|
36
|
+
switch (way.kind) {
|
|
37
|
+
case 'provider':
|
|
38
|
+
q.set('provider', way.provider);
|
|
39
|
+
return `${at}/v1/iam/oauth/authorize?${q}`;
|
|
40
|
+
case 'email':
|
|
41
|
+
q.set('login_hint', way.email);
|
|
42
|
+
return `${at}/login?${q}`;
|
|
43
|
+
case 'another':
|
|
44
|
+
q.set('prompt', 'select_account');
|
|
45
|
+
return `${at}/login?${q}`;
|
|
46
|
+
case 'signup':
|
|
47
|
+
return `${at}/signup?${q}`;
|
|
48
|
+
case 'login':
|
|
49
|
+
return `${at}/login?${q}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** The address typed, trimmed, when it reads as an email; null otherwise. */
|
|
53
|
+
function address(typed) {
|
|
54
|
+
const s = typed.trim();
|
|
55
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s) ? s : null;
|
|
56
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a Hanzo site sends somebody to sign in: hanzo.ai, never its own page.
|
|
3
|
+
*
|
|
4
|
+
* One IAM, and one origin every Hanzo site signs in on, so the session that
|
|
5
|
+
* answers every site lives on hanzo.ai. Each site is still its own OAuth client:
|
|
6
|
+
* it mints its own authorize request (its client, its callback, a fresh state and
|
|
7
|
+
* a PKCE challenge whose verifier stays in its own storage) with `getSigninUrl`,
|
|
8
|
+
* and hands hanzo.ai only the query. hanzo.ai answers it and IAM returns the code
|
|
9
|
+
* to the site's callback, where the site redeems it.
|
|
10
|
+
*
|
|
11
|
+
* a provider straight to IAM's authorize ON hanzo.ai with `provider`, which
|
|
12
|
+
* sends the browser to Google or GitHub at once (one press) and
|
|
13
|
+
* takes the provider's return on hanzo.ai, so the session lands
|
|
14
|
+
* there. Not the issuer's authorize: a provider hop that starts
|
|
15
|
+
* on hanzo.id returns to hanzo.id and leaves hanzo.ai signed out.
|
|
16
|
+
* an email hanzo.ai/login with `login_hint`, where the password or the
|
|
17
|
+
* code is typed.
|
|
18
|
+
* a new account hanzo.ai/signup.
|
|
19
|
+
*
|
|
20
|
+
* Pure, so every address is tested without a browser.
|
|
21
|
+
*/
|
|
22
|
+
/** The one origin Hanzo signs people in on. */
|
|
23
|
+
export declare const SIGNIN = "https://hanzo.ai";
|
|
24
|
+
/** The providers the shared panel draws. IAM names them by these words. */
|
|
25
|
+
export type ProviderKind = 'google' | 'github';
|
|
26
|
+
/**
|
|
27
|
+
* Where a press goes. A provider is named the way IAM names it: a kind (`google`)
|
|
28
|
+
* or a provider record's name (`provider-google`); either starts the same hop.
|
|
29
|
+
*/
|
|
30
|
+
export type Way = {
|
|
31
|
+
kind: 'provider';
|
|
32
|
+
provider: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'email';
|
|
35
|
+
email: string;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'login';
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'signup';
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'another';
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The address a press leaves for, from the site's own authorize request
|
|
45
|
+
* (`request`, as `getSigninUrl` answered it). Only its query travels.
|
|
46
|
+
*/
|
|
47
|
+
export declare function handoff(request: string, way: Way, signin?: string): string;
|
|
48
|
+
/** The address typed, trimmed, when it reads as an email; null otherwise. */
|
|
49
|
+
export declare function address(typed: string): string | null;
|
|
50
|
+
//# sourceMappingURL=handoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../src/auth/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,+CAA+C;AAC/C,eAAO,MAAM,MAAM,qBAAqB,CAAA;AAExC,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE9C;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAE1J;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAE,MAAe,GAAG,MAAM,CAkBlF;AAED,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGpD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a Hanzo site sends somebody to sign in: hanzo.ai, never its own page.
|
|
3
|
+
*
|
|
4
|
+
* One IAM, and one origin every Hanzo site signs in on, so the session that
|
|
5
|
+
* answers every site lives on hanzo.ai. Each site is still its own OAuth client:
|
|
6
|
+
* it mints its own authorize request (its client, its callback, a fresh state and
|
|
7
|
+
* a PKCE challenge whose verifier stays in its own storage) with `getSigninUrl`,
|
|
8
|
+
* and hands hanzo.ai only the query. hanzo.ai answers it and IAM returns the code
|
|
9
|
+
* to the site's callback, where the site redeems it.
|
|
10
|
+
*
|
|
11
|
+
* a provider straight to IAM's authorize ON hanzo.ai with `provider`, which
|
|
12
|
+
* sends the browser to Google or GitHub at once (one press) and
|
|
13
|
+
* takes the provider's return on hanzo.ai, so the session lands
|
|
14
|
+
* there. Not the issuer's authorize: a provider hop that starts
|
|
15
|
+
* on hanzo.id returns to hanzo.id and leaves hanzo.ai signed out.
|
|
16
|
+
* an email hanzo.ai/login with `login_hint`, where the password or the
|
|
17
|
+
* code is typed.
|
|
18
|
+
* a new account hanzo.ai/signup.
|
|
19
|
+
*
|
|
20
|
+
* Pure, so every address is tested without a browser.
|
|
21
|
+
*/
|
|
22
|
+
/** The one origin Hanzo signs people in on. */
|
|
23
|
+
export const SIGNIN = 'https://hanzo.ai';
|
|
24
|
+
/**
|
|
25
|
+
* The address a press leaves for, from the site's own authorize request
|
|
26
|
+
* (`request`, as `getSigninUrl` answered it). Only its query travels.
|
|
27
|
+
*/
|
|
28
|
+
export function handoff(request, way, signin = SIGNIN) {
|
|
29
|
+
const q = new URL(request).searchParams;
|
|
30
|
+
const at = signin.replace(/\/+$/, '');
|
|
31
|
+
switch (way.kind) {
|
|
32
|
+
case 'provider':
|
|
33
|
+
q.set('provider', way.provider);
|
|
34
|
+
return `${at}/v1/iam/oauth/authorize?${q}`;
|
|
35
|
+
case 'email':
|
|
36
|
+
q.set('login_hint', way.email);
|
|
37
|
+
return `${at}/login?${q}`;
|
|
38
|
+
case 'another':
|
|
39
|
+
q.set('prompt', 'select_account');
|
|
40
|
+
return `${at}/login?${q}`;
|
|
41
|
+
case 'signup':
|
|
42
|
+
return `${at}/signup?${q}`;
|
|
43
|
+
case 'login':
|
|
44
|
+
return `${at}/login?${q}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** The address typed, trimmed, when it reads as an email; null otherwise. */
|
|
48
|
+
export function address(typed) {
|
|
49
|
+
const s = typed.trim();
|
|
50
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s) ? s : null;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=handoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../src/auth/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAA;AAWxC;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe,EAAE,GAAQ,EAAE,MAAM,GAAW,MAAM;IACxE,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,YAAY,CAAA;IACvC,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACrC,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,UAAU;YACb,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;YAC/B,OAAO,GAAG,EAAE,2BAA2B,CAAC,EAAE,CAAA;QAC5C,KAAK,OAAO;YACV,CAAC,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;YAC9B,OAAO,GAAG,EAAE,UAAU,CAAC,EAAE,CAAA;QAC3B,KAAK,SAAS;YACZ,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAA;YACjC,OAAO,GAAG,EAAE,UAAU,CAAC,EAAE,CAAA;QAC3B,KAAK,QAAQ;YACX,OAAO,GAAG,EAAE,WAAW,CAAC,EAAE,CAAA;QAC5B,KAAK,OAAO;YACV,OAAO,GAAG,EAAE,UAAU,CAAC,EAAE,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACtB,OAAO,4BAA4B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACxD,CAAC"}
|
package/dist/auth/index.cjs
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.refresher = exports.live = exports.bearer = exports.useSignOut = exports.signOut = exports.SignIn = void 0;
|
|
3
|
+
exports.refresher = exports.live = exports.bearer = exports.useSignOut = exports.signOut = exports.SIGNIN = exports.handoff = exports.address = exports.SignInPanel = exports.SignIn = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Signing in, signing out, and the session, for every Hanzo site: IAM answers
|
|
6
6
|
* (/v1/iam), the site draws.
|
|
7
7
|
*/
|
|
8
8
|
var SignIn_1 = require("./SignIn.cjs");
|
|
9
9
|
Object.defineProperty(exports, "SignIn", { enumerable: true, get: function () { return SignIn_1.SignIn; } });
|
|
10
|
+
var SignInPanel_1 = require("./SignInPanel.cjs");
|
|
11
|
+
Object.defineProperty(exports, "SignInPanel", { enumerable: true, get: function () { return SignInPanel_1.SignInPanel; } });
|
|
12
|
+
var handoff_1 = require("./handoff.cjs");
|
|
13
|
+
Object.defineProperty(exports, "address", { enumerable: true, get: function () { return handoff_1.address; } });
|
|
14
|
+
Object.defineProperty(exports, "handoff", { enumerable: true, get: function () { return handoff_1.handoff; } });
|
|
15
|
+
Object.defineProperty(exports, "SIGNIN", { enumerable: true, get: function () { return handoff_1.SIGNIN; } });
|
|
10
16
|
var signout_1 = require("./signout.cjs");
|
|
11
17
|
Object.defineProperty(exports, "signOut", { enumerable: true, get: function () { return signout_1.signOut; } });
|
|
12
18
|
Object.defineProperty(exports, "useSignOut", { enumerable: true, get: function () { return signout_1.useSignOut; } });
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* (/v1/iam), the site draws.
|
|
4
4
|
*/
|
|
5
5
|
export { SignIn, type Mode, type Provider, type SignInProps } from './SignIn.js';
|
|
6
|
+
export { SignInPanel, type SignInPanelProps } from './SignInPanel.js';
|
|
7
|
+
export { address, handoff, SIGNIN, type ProviderKind, type Way } from './handoff.js';
|
|
6
8
|
export { signOut, useSignOut, type SignOutOptions } from './signout.js';
|
|
7
9
|
export { bearer, live, refresher } from './session.js';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAE,MAAM,WAAW,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/auth/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* (/v1/iam), the site draws.
|
|
4
4
|
*/
|
|
5
5
|
export { SignIn } from './SignIn.js';
|
|
6
|
+
export { SignInPanel } from './SignInPanel.js';
|
|
7
|
+
export { address, handoff, SIGNIN } from './handoff.js';
|
|
6
8
|
export { signOut, useSignOut } from './signout.js';
|
|
7
9
|
export { bearer, live, refresher } from './session.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAA8C,MAAM,UAAU,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAuB,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAA8C,MAAM,UAAU,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAA+B,MAAM,WAAW,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAuB,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/auth/signout.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.endSessionUrl = endSessionUrl;
|
|
4
5
|
exports.signOut = signOut;
|
|
5
6
|
exports.useSignOut = useSignOut;
|
|
6
7
|
const react_1 = require("react");
|
|
@@ -45,13 +46,30 @@ async function end(origin, idToken, clientId, everywhere) {
|
|
|
45
46
|
// The tokens are already revoked and cleared; this machine is signed out.
|
|
46
47
|
}
|
|
47
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* The issuer's end-session page a sign-out everywhere leaves through: the client,
|
|
51
|
+
* `everywhere`, and `to` as the post-logout address, which IAM follows only when
|
|
52
|
+
* the client registered it exactly and otherwise replaces with its own sign-in.
|
|
53
|
+
* No id_token_hint: a token does not belong in an address bar or a log line, and
|
|
54
|
+
* IAM names the application from client_id.
|
|
55
|
+
*/
|
|
56
|
+
function endSessionUrl(issuer, to, clientId) {
|
|
57
|
+
const q = new URLSearchParams({
|
|
58
|
+
...(clientId ? { client_id: clientId } : {}),
|
|
59
|
+
everywhere: 'true',
|
|
60
|
+
post_logout_redirect_uri: new URL(to, window.location.origin).href,
|
|
61
|
+
});
|
|
62
|
+
return `${issuer.replace(/\/+$/, '')}/v1/iam/oauth/logout?${q}`;
|
|
63
|
+
}
|
|
48
64
|
/**
|
|
49
65
|
* Sign out: hand both tokens back to IAM through its /v1/iam revocation route
|
|
50
66
|
* (a same-site call, refresh token first, since it is the one that mints more),
|
|
51
67
|
* end IAM's session cookie, clear the local session, and land on the site's own
|
|
52
|
-
* `/login?from=logout`.
|
|
68
|
+
* `/login?from=logout`. A sign-out `everywhere` with an `issuer` lands through the
|
|
69
|
+
* issuer's end-session page instead (`endSessionUrl`), so the sessions on the
|
|
70
|
+
* issuer's other sign-in origins end too.
|
|
53
71
|
*/
|
|
54
|
-
async function signOut(iam, { via, to = '/login?from=logout', clientId, track, everywhere } = {}) {
|
|
72
|
+
async function signOut(iam, { via, to = '/login?from=logout', clientId, track, everywhere, issuer } = {}) {
|
|
55
73
|
const origin = via ?? window.location.origin;
|
|
56
74
|
const access = (0, session_1.bearer)();
|
|
57
75
|
const refresh = (0, session_1.refresher)();
|
|
@@ -64,12 +82,12 @@ async function signOut(iam, { via, to = '/login?from=logout', clientId, track, e
|
|
|
64
82
|
}
|
|
65
83
|
finally {
|
|
66
84
|
track?.('logout_completed', {});
|
|
67
|
-
window.location.assign(to);
|
|
85
|
+
window.location.assign(everywhere && issuer ? endSessionUrl(issuer, to, clientId) : to);
|
|
68
86
|
}
|
|
69
87
|
}
|
|
70
88
|
/** `signOut` bound to the page's IAM client. */
|
|
71
89
|
function useSignOut(options = {}) {
|
|
72
90
|
const { sdk, config } = (0, react_2.useIam)();
|
|
73
|
-
const { via, to, track, clientId = config.clientId, everywhere } = options;
|
|
74
|
-
return (0, react_1.useCallback)(() => signOut(sdk, { via, to, track, clientId, everywhere }), [sdk, via, to, track, clientId, everywhere]);
|
|
91
|
+
const { via, to, track, clientId = config.clientId, everywhere, issuer = config.serverUrl } = options;
|
|
92
|
+
return (0, react_1.useCallback)(() => signOut(sdk, { via, to, track, clientId, everywhere, issuer }), [sdk, via, to, track, clientId, everywhere, issuer]);
|
|
75
93
|
}
|
package/dist/auth/signout.d.ts
CHANGED
|
@@ -15,14 +15,35 @@ export interface SignOutOptions {
|
|
|
15
15
|
* too. An application of another organization keeps its grant.
|
|
16
16
|
*/
|
|
17
17
|
everywhere?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The issuer (the IAM config's `serverUrl`, https://hanzo.id). With
|
|
20
|
+
* `everywhere`, the sign-out ENDS on the issuer's end-session page as a
|
|
21
|
+
* top-level navigation, because a session lives on each of the issuer's
|
|
22
|
+
* sign-in origins (hanzo.id, hanzo.ai, hanzo.market) behind a host-only cookie
|
|
23
|
+
* this page cannot reach: IAM ends the one on each origin in turn (hanzoai/iam
|
|
24
|
+
* logout `nextSignout`) and the browser lands on the issuer's sign-in, which is
|
|
25
|
+
* hanzo.ai/login, or on `to` when the client registered it. Without an issuer
|
|
26
|
+
* the sign-out ends here, as before.
|
|
27
|
+
*/
|
|
28
|
+
issuer?: string;
|
|
18
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* The issuer's end-session page a sign-out everywhere leaves through: the client,
|
|
32
|
+
* `everywhere`, and `to` as the post-logout address, which IAM follows only when
|
|
33
|
+
* the client registered it exactly and otherwise replaces with its own sign-in.
|
|
34
|
+
* No id_token_hint: a token does not belong in an address bar or a log line, and
|
|
35
|
+
* IAM names the application from client_id.
|
|
36
|
+
*/
|
|
37
|
+
export declare function endSessionUrl(issuer: string, to: string, clientId?: string): string;
|
|
19
38
|
/**
|
|
20
39
|
* Sign out: hand both tokens back to IAM through its /v1/iam revocation route
|
|
21
40
|
* (a same-site call, refresh token first, since it is the one that mints more),
|
|
22
41
|
* end IAM's session cookie, clear the local session, and land on the site's own
|
|
23
|
-
* `/login?from=logout`.
|
|
42
|
+
* `/login?from=logout`. A sign-out `everywhere` with an `issuer` lands through the
|
|
43
|
+
* issuer's end-session page instead (`endSessionUrl`), so the sessions on the
|
|
44
|
+
* issuer's other sign-in origins end too.
|
|
24
45
|
*/
|
|
25
|
-
export declare function signOut(iam: IAM, { via, to, clientId, track, everywhere }?: SignOutOptions): Promise<void>;
|
|
46
|
+
export declare function signOut(iam: IAM, { via, to, clientId, track, everywhere, issuer }?: SignOutOptions): Promise<void>;
|
|
26
47
|
/** `signOut` bound to the page's IAM client. */
|
|
27
48
|
export declare function useSignOut(options?: SignOutOptions): () => Promise<void>;
|
|
28
49
|
//# sourceMappingURL=signout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signout.d.ts","sourceRoot":"","sources":["../../src/auth/signout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAIrC,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CA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AAU,CAAC,OAAO,GAAE,cAAmB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAI5E"}
|
package/dist/auth/signout.js
CHANGED
|
@@ -41,13 +41,30 @@ async function end(origin, idToken, clientId, everywhere) {
|
|
|
41
41
|
// The tokens are already revoked and cleared; this machine is signed out.
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* The issuer's end-session page a sign-out everywhere leaves through: the client,
|
|
46
|
+
* `everywhere`, and `to` as the post-logout address, which IAM follows only when
|
|
47
|
+
* the client registered it exactly and otherwise replaces with its own sign-in.
|
|
48
|
+
* No id_token_hint: a token does not belong in an address bar or a log line, and
|
|
49
|
+
* IAM names the application from client_id.
|
|
50
|
+
*/
|
|
51
|
+
export function endSessionUrl(issuer, to, clientId) {
|
|
52
|
+
const q = new URLSearchParams({
|
|
53
|
+
...(clientId ? { client_id: clientId } : {}),
|
|
54
|
+
everywhere: 'true',
|
|
55
|
+
post_logout_redirect_uri: new URL(to, window.location.origin).href,
|
|
56
|
+
});
|
|
57
|
+
return `${issuer.replace(/\/+$/, '')}/v1/iam/oauth/logout?${q}`;
|
|
58
|
+
}
|
|
44
59
|
/**
|
|
45
60
|
* Sign out: hand both tokens back to IAM through its /v1/iam revocation route
|
|
46
61
|
* (a same-site call, refresh token first, since it is the one that mints more),
|
|
47
62
|
* end IAM's session cookie, clear the local session, and land on the site's own
|
|
48
|
-
* `/login?from=logout`.
|
|
63
|
+
* `/login?from=logout`. A sign-out `everywhere` with an `issuer` lands through the
|
|
64
|
+
* issuer's end-session page instead (`endSessionUrl`), so the sessions on the
|
|
65
|
+
* issuer's other sign-in origins end too.
|
|
49
66
|
*/
|
|
50
|
-
export async function signOut(iam, { via, to = '/login?from=logout', clientId, track, everywhere } = {}) {
|
|
67
|
+
export async function signOut(iam, { via, to = '/login?from=logout', clientId, track, everywhere, issuer } = {}) {
|
|
51
68
|
const origin = via ?? window.location.origin;
|
|
52
69
|
const access = bearer();
|
|
53
70
|
const refresh = refresher();
|
|
@@ -60,13 +77,13 @@ export async function signOut(iam, { via, to = '/login?from=logout', clientId, t
|
|
|
60
77
|
}
|
|
61
78
|
finally {
|
|
62
79
|
track?.('logout_completed', {});
|
|
63
|
-
window.location.assign(to);
|
|
80
|
+
window.location.assign(everywhere && issuer ? endSessionUrl(issuer, to, clientId) : to);
|
|
64
81
|
}
|
|
65
82
|
}
|
|
66
83
|
/** `signOut` bound to the page's IAM client. */
|
|
67
84
|
export function useSignOut(options = {}) {
|
|
68
85
|
const { sdk, config } = useIam();
|
|
69
|
-
const { via, to, track, clientId = config.clientId, everywhere } = options;
|
|
70
|
-
return useCallback(() => signOut(sdk, { via, to, track, clientId, everywhere }), [sdk, via, to, track, clientId, everywhere]);
|
|
86
|
+
const { via, to, track, clientId = config.clientId, everywhere, issuer = config.serverUrl } = options;
|
|
87
|
+
return useCallback(() => signOut(sdk, { via, to, track, clientId, everywhere, issuer }), [sdk, via, to, track, clientId, everywhere, issuer]);
|
|
71
88
|
}
|
|
72
89
|
//# sourceMappingURL=signout.js.map
|
package/dist/auth/signout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signout.js","sourceRoot":"","sources":["../../src/auth/signout.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"signout.js","sourceRoot":"","sources":["../../src/auth/signout.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,M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,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;QAC9D,MAAM,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;IAClD,CAAC;YAAS,CAAC;QACT,KAAK,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAC/B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACzF,CAAC;AACH,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,UAAU,CAAC,OAAO,GAAmB,EAAE;IACrD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;IAChC,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,GAAG,OAAO,CAAA;IACrG,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;AAC/I,CAAC"}
|
|
@@ -45,7 +45,7 @@ export const frame = (size) => ({
|
|
|
45
45
|
style: size === 'fullscreen'
|
|
46
46
|
? undefined
|
|
47
47
|
: {
|
|
48
|
-
boxShadow: '
|
|
48
|
+
boxShadow: 'none',
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
51
|
/** The scrim under a sized dialog: black at 72%, opaque layer. */
|
|
@@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}
|
package/dist/gallery.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.
|
|
1
|
+
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.32.0</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
|
|
2
2
|
:root { --hanzo-ui-styles: 1; }
|
|
3
3
|
/* Hanzo Design System — the entry point. Import THIS one file.
|
|
4
4
|
*
|