@micha.bigler/ui-core-micha 4.12.0 → 4.14.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/CHANGELOG.md +23 -0
- package/README.md +72 -0
- package/dist/auth/termsApi.js +12 -0
- package/dist/billing/api.js +29 -1
- package/dist/billing/wire.js +1 -0
- package/dist/components/LoginContent.js +293 -0
- package/dist/components/ProfileComponent.js +12 -30
- package/dist/components/ProfileStepContent.js +237 -0
- package/dist/components/SignUpContent.js +155 -0
- package/dist/components/SignupConfirmContent.js +62 -0
- package/dist/i18n/authTranslations.js +96 -0
- package/dist/i18n/onboardingTranslations.js +2 -0
- package/dist/index.js +8 -1
- package/dist/onboarding/SetupWizardShell.js +114 -0
- package/dist/pages/LoginPage.js +7 -250
- package/dist/pages/SignUpPage.js +13 -97
- package/dist/pages/SignupConfirmPage.js +13 -50
- package/dist/theme/kitSxRegistry.js +13 -0
- package/dist/utils/chunkLoadRecovery.js +65 -0
- package/dist/utils/continuation.js +48 -0
- package/dist/utils/profileDraft.js +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Alert, Box, Button, Checkbox, FormControlLabel, Link, Stack, TextField, Typography, } from '@mui/material';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { AuthContext } from '../auth/AuthContext';
|
|
6
|
+
import { fetchPrivacyStatement, updateUserProfile } from '../auth/authApi';
|
|
7
|
+
import { defaultTermsApi } from '../auth/termsApi';
|
|
8
|
+
import { resolveErrorText } from '../utils/resolveErrorText';
|
|
9
|
+
import { profileIdentity, refreshProfileDraft } from '../utils/profileDraft';
|
|
10
|
+
export const PROFILE_STEP_OPTION_SX = { alignItems: 'flex-start' };
|
|
11
|
+
export const PROFILE_STEP_CHECKBOX_SX = { mt: -0.5 };
|
|
12
|
+
// Only http(s) documents are linked; the terms URL comes from the server.
|
|
13
|
+
function safeDocumentUrl(value) {
|
|
14
|
+
if (typeof value !== 'string' || !value)
|
|
15
|
+
return null;
|
|
16
|
+
try {
|
|
17
|
+
const url = new URL(value);
|
|
18
|
+
return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : null;
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function termsFromResponse(body) {
|
|
25
|
+
return {
|
|
26
|
+
document: (body === null || body === void 0 ? void 0 : body.document) || null,
|
|
27
|
+
accepted: (body === null || body === void 0 ? void 0 : body.accepted) === true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Profile completion for a setup flow: first and last name, one required
|
|
32
|
+
* statement and the optional convenience cookies.
|
|
33
|
+
*
|
|
34
|
+
* Without `termsEnabled` the required statement is the privacy statement, as in
|
|
35
|
+
* the existing profile. With `termsEnabled` (requires django-core-micha >= 3.16.0
|
|
36
|
+
* and the app's terms API) it is one combined statement for the terms of use and
|
|
37
|
+
* the privacy statement. It is pre-checked only when the server reports the
|
|
38
|
+
* current terms version as accepted AND privacy as accepted; never because of a
|
|
39
|
+
* provider login, an existing account or privacy alone. Without `termsEnabled` no
|
|
40
|
+
* terms request is made.
|
|
41
|
+
*
|
|
42
|
+
* Props:
|
|
43
|
+
* - `draft` / `onDraftChange(draft)`: host-controlled draft
|
|
44
|
+
* `{ identity, values: { firstName, lastName, acceptedPrivacy, acceptedCookies },
|
|
45
|
+
* editedFields: [...] }`. A draft is shown only for the person it belongs to;
|
|
46
|
+
* for anyone else the current person's server values are used. Without
|
|
47
|
+
* `onDraftChange` the draft is kept inside the component.
|
|
48
|
+
* - `onComplete(user)`: called only after every required write succeeded (the
|
|
49
|
+
* profile update and, with terms, the acceptance). Repeating after a partial
|
|
50
|
+
* failure is safe; both writes are idempotent.
|
|
51
|
+
* - `termsApi` (default `defaultTermsApi`): a `createTermsApi()` client, for an
|
|
52
|
+
* app that mounts the terms API at another prefix. Create it once (module
|
|
53
|
+
* level); a new object on every render reloads the terms each time.
|
|
54
|
+
* - `privacyUrl`: link target for the privacy statement; without it the statement
|
|
55
|
+
* text can be shown inline.
|
|
56
|
+
* - `formId`: renders the form with this id and without its own submit button, so
|
|
57
|
+
* a host action (for example `SetupWizardShell`'s `primaryForm`) submits it.
|
|
58
|
+
* - `submitLabel`, `disabled`, `onBusyChange(busy)`.
|
|
59
|
+
*/
|
|
60
|
+
export function ProfileStepContent({ draft, onDraftChange, onComplete, onBusyChange, termsEnabled = false, termsApi = defaultTermsApi, privacyUrl, formId, submitLabel, disabled = false, }) {
|
|
61
|
+
var _a;
|
|
62
|
+
const { t, i18n } = useTranslation();
|
|
63
|
+
const { user, login } = useContext(AuthContext) || {};
|
|
64
|
+
const identity = profileIdentity(user);
|
|
65
|
+
const [internalDraft, setInternalDraft] = useState(null);
|
|
66
|
+
const [terms, setTerms] = useState(null); // { owner, document, accepted }
|
|
67
|
+
const [termsChecked, setTermsChecked] = useState(false);
|
|
68
|
+
const [privacyOpen, setPrivacyOpen] = useState(false);
|
|
69
|
+
const [privacyText, setPrivacyText] = useState('');
|
|
70
|
+
const [errorKey, setErrorKey] = useState(null);
|
|
71
|
+
const [saving, setSaving] = useState(false);
|
|
72
|
+
// Synchronous guard: two submits in the same tick both still see `saving` false.
|
|
73
|
+
const savingRef = useRef(false);
|
|
74
|
+
const errorRef = useRef(null);
|
|
75
|
+
const activeDraft = onDraftChange ? draft : internalDraft;
|
|
76
|
+
const draftMatches = Boolean(activeDraft) && activeDraft.identity === identity;
|
|
77
|
+
const editedFields = new Set(draftMatches ? activeDraft.editedFields || [] : []);
|
|
78
|
+
const { values } = refreshProfileDraft(user, identity, editedFields, draftMatches ? activeDraft.values || {} : {});
|
|
79
|
+
const currentTerms = terms && terms.owner === identity ? terms : null;
|
|
80
|
+
const commit = (patch) => {
|
|
81
|
+
Object.keys(patch).forEach((key) => editedFields.add(key));
|
|
82
|
+
const next = {
|
|
83
|
+
identity,
|
|
84
|
+
values: Object.assign({ firstName: values.firstName, lastName: values.lastName, acceptedPrivacy: values.acceptedPrivacy, acceptedCookies: values.acceptedCookies }, patch),
|
|
85
|
+
editedFields: [...editedFields],
|
|
86
|
+
};
|
|
87
|
+
if (onDraftChange)
|
|
88
|
+
onDraftChange(next);
|
|
89
|
+
else
|
|
90
|
+
setInternalDraft(next);
|
|
91
|
+
};
|
|
92
|
+
const applyTerms = useCallback((body, owner, privacyAccepted) => {
|
|
93
|
+
const next = termsFromResponse(body);
|
|
94
|
+
setTerms(Object.assign({ owner }, next));
|
|
95
|
+
setTermsChecked(next.accepted && Boolean(privacyAccepted));
|
|
96
|
+
return next;
|
|
97
|
+
}, []);
|
|
98
|
+
// Terms evidence is per person: reset and reload whenever the identity changes.
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
setTerms(null);
|
|
101
|
+
setTermsChecked(false);
|
|
102
|
+
if (!termsEnabled || !user)
|
|
103
|
+
return undefined;
|
|
104
|
+
let active = true;
|
|
105
|
+
const privacyAccepted = Boolean(user.accepted_privacy_statement);
|
|
106
|
+
termsApi.getAcceptance()
|
|
107
|
+
.then((body) => {
|
|
108
|
+
if (active)
|
|
109
|
+
applyTerms(body, identity, privacyAccepted);
|
|
110
|
+
})
|
|
111
|
+
.catch(() => {
|
|
112
|
+
// The terms API answers with machine codes (e.g. terms_not_configured),
|
|
113
|
+
// not display text, so the step shows its own message.
|
|
114
|
+
if (active)
|
|
115
|
+
setErrorKey(t('Auth.TERMS_LOAD_FAILED'));
|
|
116
|
+
});
|
|
117
|
+
return () => {
|
|
118
|
+
active = false;
|
|
119
|
+
};
|
|
120
|
+
}, [termsEnabled, termsApi, identity]);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
onBusyChange === null || onBusyChange === void 0 ? void 0 : onBusyChange(saving);
|
|
123
|
+
}, [saving]);
|
|
124
|
+
// A validation or save error takes focus, so keyboard and screen-reader users
|
|
125
|
+
// land on it instead of staying on the submit control.
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
var _a;
|
|
128
|
+
if (errorKey)
|
|
129
|
+
(_a = errorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
130
|
+
}, [errorKey]);
|
|
131
|
+
const togglePrivacyText = async () => {
|
|
132
|
+
if (!privacyOpen && !privacyText) {
|
|
133
|
+
try {
|
|
134
|
+
setPrivacyText(await fetchPrivacyStatement());
|
|
135
|
+
}
|
|
136
|
+
catch (_a) {
|
|
137
|
+
// Non-fatal: the link simply won't reveal inline text this time.
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
setPrivacyOpen((previous) => !previous);
|
|
141
|
+
};
|
|
142
|
+
const requiredChecked = termsEnabled ? termsChecked : Boolean(values.acceptedPrivacy);
|
|
143
|
+
const handleRequiredChange = (event) => {
|
|
144
|
+
const { checked } = event.target;
|
|
145
|
+
if (termsEnabled)
|
|
146
|
+
setTermsChecked(checked);
|
|
147
|
+
commit({ acceptedPrivacy: checked });
|
|
148
|
+
};
|
|
149
|
+
// Returns true when the acceptance is on record for the current version.
|
|
150
|
+
const acceptCurrentTerms = async (version) => {
|
|
151
|
+
var _a;
|
|
152
|
+
try {
|
|
153
|
+
const body = await termsApi.accept(version);
|
|
154
|
+
const accepted = applyTerms(body, identity, true).accepted;
|
|
155
|
+
if (!accepted)
|
|
156
|
+
throw new Error('terms_not_confirmed');
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
const body = ((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) === 409 ? err.response.data : null;
|
|
161
|
+
if ((body === null || body === void 0 ? void 0 : body.detail) === 'version_mismatch') {
|
|
162
|
+
// The page showed an older version: take the current document and the
|
|
163
|
+
// person's actual acceptance of it from the 409 body.
|
|
164
|
+
if (applyTerms(body, identity, true).accepted)
|
|
165
|
+
return true;
|
|
166
|
+
setTermsChecked(false);
|
|
167
|
+
setErrorKey(t('Auth.TERMS_VERSION_CHANGED'));
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
throw err;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const handleSubmit = async (event) => {
|
|
174
|
+
var _a;
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
if (savingRef.current || disabled || !user)
|
|
177
|
+
return;
|
|
178
|
+
if (!(values.firstName || '').trim() || !(values.lastName || '').trim()) {
|
|
179
|
+
setErrorKey(t('Auth.PROFILE_NAME_REQUIRED'));
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!requiredChecked) {
|
|
183
|
+
setErrorKey(t(termsEnabled ? 'Auth.TERMS_PRIVACY_REQUIRED' : 'Auth.PRIVACY_REQUIRED'));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
savingRef.current = true;
|
|
187
|
+
setSaving(true);
|
|
188
|
+
setErrorKey(null);
|
|
189
|
+
let stage = 'terms_load';
|
|
190
|
+
try {
|
|
191
|
+
let termsState = currentTerms;
|
|
192
|
+
if (termsEnabled && !termsState) {
|
|
193
|
+
const body = await termsApi.getAcceptance();
|
|
194
|
+
termsState = Object.assign({ owner: identity }, termsFromResponse(body));
|
|
195
|
+
setTerms(termsState);
|
|
196
|
+
}
|
|
197
|
+
if (termsEnabled && !((_a = termsState === null || termsState === void 0 ? void 0 : termsState.document) === null || _a === void 0 ? void 0 : _a.version)) {
|
|
198
|
+
throw new Error('terms_not_available');
|
|
199
|
+
}
|
|
200
|
+
stage = 'profile';
|
|
201
|
+
const updatedUser = await updateUserProfile({
|
|
202
|
+
first_name: (values.firstName || '').trim(),
|
|
203
|
+
last_name: (values.lastName || '').trim(),
|
|
204
|
+
accepted_privacy_statement: true,
|
|
205
|
+
accepted_convenience_cookies: Boolean(values.acceptedCookies),
|
|
206
|
+
});
|
|
207
|
+
if (updatedUser)
|
|
208
|
+
login === null || login === void 0 ? void 0 : login(updatedUser);
|
|
209
|
+
if (termsEnabled && !termsState.accepted) {
|
|
210
|
+
stage = 'terms';
|
|
211
|
+
const accepted = await acceptCurrentTerms(termsState.document.version);
|
|
212
|
+
if (!accepted)
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete(updatedUser || user);
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
if (stage === 'profile') {
|
|
219
|
+
setErrorKey(resolveErrorText(i18n, err, 'Auth.PROFILE_UPDATE_FAILED'));
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
setErrorKey(t(stage === 'terms' ? 'Auth.TERMS_ACCEPTANCE_FAILED' : 'Auth.TERMS_LOAD_FAILED'));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
savingRef.current = false;
|
|
227
|
+
setSaving(false);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const privacyHref = safeDocumentUrl(privacyUrl);
|
|
231
|
+
const termsHref = safeDocumentUrl((_a = currentTerms === null || currentTerms === void 0 ? void 0 : currentTerms.document) === null || _a === void 0 ? void 0 : _a.url);
|
|
232
|
+
const busy = disabled || saving;
|
|
233
|
+
const privacyLink = privacyHref ? (_jsx(Link, { href: privacyHref, target: "_blank", rel: "noopener noreferrer", children: t('Auth.PRIVACY_LINK_LABEL') })) : (_jsx(Link, { component: "button", type: "button", variant: "body1", onClick: togglePrivacyText, sx: { verticalAlign: 'baseline' }, children: t('Auth.PRIVACY_LINK_LABEL') }));
|
|
234
|
+
const termsLink = termsHref ? (_jsx(Link, { href: termsHref, target: "_blank", rel: "noopener noreferrer", children: t('Auth.TERMS_LINK_LABEL') })) : t('Auth.TERMS_LINK_LABEL');
|
|
235
|
+
const requiredLabel = termsEnabled ? (_jsxs("span", { children: [t('Auth.TERMS_PRIVACY_PREFIX'), termsLink, t('Auth.TERMS_PRIVACY_AND'), privacyLink, t('Auth.TERMS_PRIVACY_SUFFIX')] })) : (_jsxs("span", { children: [t('Auth.PRIVACY_REQUIRED_LABEL'), ' ', privacyLink, t('Auth.TERMS_PRIVACY_SUFFIX')] }));
|
|
236
|
+
return (_jsxs(Box, { component: "form", id: formId, onSubmit: handleSubmit, noValidate: true, "aria-busy": saving || undefined, sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [errorKey && _jsx(Alert, { ref: errorRef, severity: "error", tabIndex: -1, children: errorKey }), _jsx(TextField, { label: t('Profile.FIRST_NAME_LABEL'), value: values.firstName || '', onChange: (event) => commit({ firstName: event.target.value }), autoComplete: "given-name", required: true, fullWidth: true, disabled: busy }), _jsx(TextField, { label: t('Profile.LAST_NAME_LABEL'), value: values.lastName || '', onChange: (event) => commit({ lastName: event.target.value }), autoComplete: "family-name", required: true, fullWidth: true, disabled: busy }), _jsxs(Stack, { spacing: 0.5, children: [_jsx(FormControlLabel, { sx: PROFILE_STEP_OPTION_SX, control: (_jsx(Checkbox, { checked: requiredChecked, onChange: handleRequiredChange, disabled: busy || (termsEnabled && !currentTerms), sx: PROFILE_STEP_CHECKBOX_SX })), label: requiredLabel }), privacyOpen && privacyText && !privacyHref && (_jsx(Typography, { variant: "body2", color: "text.secondary", sx: { whiteSpace: 'pre-wrap', pl: 4 }, children: privacyText })), _jsx(FormControlLabel, { sx: PROFILE_STEP_OPTION_SX, control: (_jsx(Checkbox, { checked: Boolean(values.acceptedCookies), onChange: (event) => commit({ acceptedCookies: event.target.checked }), disabled: busy, sx: PROFILE_STEP_CHECKBOX_SX })), label: t('Auth.CONVENIENCE_COOKIES_LABEL') })] }), !formId && (_jsx(Box, { children: _jsx(Button, { type: "submit", variant: "contained", disabled: busy, children: submitLabel || t('Profile.SAVE_BUTTON') }) }))] }));
|
|
237
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { Alert, Box, Button, Divider, Stack, TextField, } from '@mui/material';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { AuthContext } from '../auth/AuthContext';
|
|
6
|
+
import { submitRegistrationRequest } from '../auth/authApi';
|
|
7
|
+
import { TurnstileWidget } from './TurnstileWidget';
|
|
8
|
+
import { SocialLoginButtons } from './SocialLoginButtons';
|
|
9
|
+
import { startSocialLogin } from '../utils/authService';
|
|
10
|
+
import { sanitizeContinuation } from '../utils/continuation';
|
|
11
|
+
import { resolveErrorText } from '../utils/resolveErrorText';
|
|
12
|
+
export const SIGN_UP_PAGE_ALERT_SX = { mb: 2 };
|
|
13
|
+
export const SIGN_UP_PROVIDER_ALERT_SX = { mt: 2 };
|
|
14
|
+
export const SIGN_UP_PROVIDER_DIVIDER_SX = { mt: 2 };
|
|
15
|
+
const TURNSTILE_SIGNUP_MODES = new Set([
|
|
16
|
+
'self_signup_open',
|
|
17
|
+
'self_signup_email_domain',
|
|
18
|
+
]);
|
|
19
|
+
const MODE_LABELS = {
|
|
20
|
+
self_signup_access_code: 'Auth.SIGNUP_ACCESS_CODE_TAB',
|
|
21
|
+
self_signup_open: 'Auth.SIGNUP_OPEN_TAB',
|
|
22
|
+
self_signup_email_domain: 'Auth.SIGNUP_EMAIL_DOMAIN_TAB',
|
|
23
|
+
self_signup_qr: 'Auth.SIGNUP_QR_TAB',
|
|
24
|
+
};
|
|
25
|
+
const PROVIDER_NAMES = { google: 'Google', microsoft: 'Microsoft' };
|
|
26
|
+
export function resolveSignupModes(authMethods) {
|
|
27
|
+
const configured = Array.isArray(authMethods === null || authMethods === void 0 ? void 0 : authMethods.signup_modes)
|
|
28
|
+
? authMethods.signup_modes.filter(Boolean)
|
|
29
|
+
: [];
|
|
30
|
+
if (configured.length > 0) {
|
|
31
|
+
return configured;
|
|
32
|
+
}
|
|
33
|
+
return (authMethods === null || authMethods === void 0 ? void 0 : authMethods.signup) ? ['self_signup_access_code'] : [];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The sign-up form shared by SignUpPage and embedded flows: every configured
|
|
37
|
+
* sign-up mode, Turnstile, the QR registration context and the existing
|
|
38
|
+
* registration request.
|
|
39
|
+
*
|
|
40
|
+
* Props:
|
|
41
|
+
* - `registrationContextToken`: the QR token (SignUpPage passes `?rt`).
|
|
42
|
+
* - `onModeChange(mode)`: reports the selected sign-up mode.
|
|
43
|
+
* - `onSubmitted(email)`: embedded use. Called after the request succeeded with
|
|
44
|
+
* the email only; the component then shows the confirmation instruction instead
|
|
45
|
+
* of the form (remount it, e.g. with a new `key`, to let the person change the
|
|
46
|
+
* email). Without it the form stays with the success message, as on the page.
|
|
47
|
+
* - `showProviders` (default false) and `continuation`: Google/Microsoft entry
|
|
48
|
+
* above the email form when the app enables it; the validated continuation is
|
|
49
|
+
* the provider callback URL.
|
|
50
|
+
* The access code, QR token and Turnstile token never leave this component.
|
|
51
|
+
*/
|
|
52
|
+
export function SignUpContent({ registrationContextToken = '', onModeChange, onSubmitted, showProviders = false, continuation, }) {
|
|
53
|
+
const { t, i18n } = useTranslation();
|
|
54
|
+
const { authMethods } = useContext(AuthContext) || {};
|
|
55
|
+
const signupModes = useMemo(() => resolveSignupModes(authMethods), [authMethods]);
|
|
56
|
+
const initialMode = useMemo(() => {
|
|
57
|
+
if (registrationContextToken && signupModes.includes('self_signup_qr')) {
|
|
58
|
+
return 'self_signup_qr';
|
|
59
|
+
}
|
|
60
|
+
return signupModes[0] || 'self_signup_access_code';
|
|
61
|
+
}, [signupModes, registrationContextToken]);
|
|
62
|
+
const [mode, setMode] = useState(initialMode);
|
|
63
|
+
const [email, setEmail] = useState('');
|
|
64
|
+
const [accessCode, setAccessCode] = useState('');
|
|
65
|
+
const [submitting, setSubmitting] = useState(false);
|
|
66
|
+
const [successKey, setSuccessKey] = useState(null);
|
|
67
|
+
const [errorKey, setErrorKey] = useState(null);
|
|
68
|
+
const [turnstileToken, setTurnstileToken] = useState('');
|
|
69
|
+
const [providerTransition, setProviderTransition] = useState('');
|
|
70
|
+
const turnstileWidgetRef = useRef(null);
|
|
71
|
+
const turnstileRequired = Boolean(authMethods === null || authMethods === void 0 ? void 0 : authMethods.turnstile_site_key)
|
|
72
|
+
&& TURNSTILE_SIGNUP_MODES.has(mode);
|
|
73
|
+
const socialProviders = Array.isArray(authMethods === null || authMethods === void 0 ? void 0 : authMethods.social_providers)
|
|
74
|
+
? authMethods.social_providers
|
|
75
|
+
: [];
|
|
76
|
+
const providersVisible = showProviders
|
|
77
|
+
&& Boolean(authMethods === null || authMethods === void 0 ? void 0 : authMethods.social_login)
|
|
78
|
+
&& socialProviders.length > 0;
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
setMode(initialMode);
|
|
81
|
+
}, [initialMode]);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
onModeChange === null || onModeChange === void 0 ? void 0 : onModeChange(mode);
|
|
84
|
+
}, [mode]);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
setTurnstileToken('');
|
|
87
|
+
}, [mode, authMethods === null || authMethods === void 0 ? void 0 : authMethods.turnstile_site_key]);
|
|
88
|
+
const handleProviderLogin = async (provider) => {
|
|
89
|
+
setErrorKey(null);
|
|
90
|
+
setProviderTransition(provider);
|
|
91
|
+
const callbackUrl = sanitizeContinuation(continuation);
|
|
92
|
+
try {
|
|
93
|
+
await startSocialLogin(provider, callbackUrl ? { callbackUrl } : {});
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
setProviderTransition('');
|
|
97
|
+
setErrorKey(resolveErrorText(i18n, err, 'Auth.SOCIAL_LOGIN_FAILED'));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const handleSubmit = async (event) => {
|
|
101
|
+
var _a;
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
setSuccessKey(null);
|
|
104
|
+
setErrorKey(null);
|
|
105
|
+
if (!email) {
|
|
106
|
+
setErrorKey(t('Auth.EMAIL_REQUIRED'));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (mode === 'self_signup_access_code' && !accessCode) {
|
|
110
|
+
setErrorKey(t('Auth.SIGNUP_ACCESS_CODE_REQUIRED'));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (mode === 'self_signup_qr' && !registrationContextToken) {
|
|
114
|
+
setErrorKey(t('Auth.SIGNUP_QR_INVALID'));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (turnstileRequired && !turnstileToken)
|
|
118
|
+
return;
|
|
119
|
+
setSubmitting(true);
|
|
120
|
+
try {
|
|
121
|
+
const res = await submitRegistrationRequest({
|
|
122
|
+
email,
|
|
123
|
+
mode,
|
|
124
|
+
accessCode,
|
|
125
|
+
registrationContextToken: mode === 'self_signup_qr' ? registrationContextToken : null,
|
|
126
|
+
turnstileToken: turnstileRequired ? turnstileToken : undefined,
|
|
127
|
+
});
|
|
128
|
+
// The backend's own response code is already mode-agnostic and accurate
|
|
129
|
+
// (Auth.INVITE_SENT). Falling back to the access-code-specific "if valid,
|
|
130
|
+
// an invite was sent" wording here was wrong for open/email-domain/QR
|
|
131
|
+
// signup, which have no code whose validity needs hiding.
|
|
132
|
+
setSuccessKey((res === null || res === void 0 ? void 0 : res.code) || 'Auth.INVITE_SENT');
|
|
133
|
+
onSubmitted === null || onSubmitted === void 0 ? void 0 : onSubmitted(email);
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
setErrorKey(resolveErrorText(i18n, err, 'Auth.INVITE_FAILED'));
|
|
137
|
+
if (turnstileRequired) {
|
|
138
|
+
setTurnstileToken('');
|
|
139
|
+
(_a = turnstileWidgetRef.current) === null || _a === void 0 ? void 0 : _a.reset();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
setSubmitting(false);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
if (signupModes.length === 0) {
|
|
147
|
+
return (_jsx(Alert, { severity: "info", sx: SIGN_UP_PAGE_ALERT_SX, children: t('Auth.SELF_SIGNUP_DISABLED', 'Self sign-up is currently disabled.') }));
|
|
148
|
+
}
|
|
149
|
+
if (onSubmitted && successKey) {
|
|
150
|
+
return (_jsxs(Stack, { spacing: 2, children: [_jsx(Alert, { severity: "success", children: t(successKey, { email }) }), _jsx(Alert, { severity: "info", children: t('Auth.CONFIRMATION_EMAIL_INSTRUCTION') })] }));
|
|
151
|
+
}
|
|
152
|
+
return (_jsxs(_Fragment, { children: [successKey && (_jsx(Alert, { severity: "success", sx: SIGN_UP_PAGE_ALERT_SX, children: t(successKey, { email }) })), errorKey && (_jsx(Alert, { severity: "error", sx: SIGN_UP_PAGE_ALERT_SX, children: errorKey })), providersVisible && (_jsxs(Box, { sx: { mb: 2 }, children: [_jsx(SocialLoginButtons, { onProviderClick: handleProviderLogin, providers: socialProviders }), providerTransition && (_jsx(Alert, { severity: "info", sx: SIGN_UP_PROVIDER_ALERT_SX, children: t('Auth.PROVIDER_TRANSITION', { provider: PROVIDER_NAMES[providerTransition] || providerTransition }) })), _jsx(Divider, { sx: SIGN_UP_PROVIDER_DIVIDER_SX, children: t('Auth.LOGIN_OR') })] })), signupModes.length > 1 && (_jsx(Stack, { spacing: 1, sx: { mb: 2 }, children: signupModes.map((entry) => (_jsx(Button, { variant: mode === entry ? 'contained' : 'outlined', onClick: () => setMode(entry), disabled: submitting, fullWidth: true, children: t(MODE_LABELS[entry] || entry, entry) }, entry))) })), _jsxs(Box, { component: "form", onSubmit: handleSubmit, sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(TextField, { label: t('Auth.EMAIL_LABEL'), type: "email", required: true, fullWidth: true, value: email, onChange: (e) => setEmail(e.target.value), disabled: submitting }), mode === 'self_signup_access_code' && (_jsx(TextField, { label: t('Auth.ACCESS_CODE_LABEL'), type: "text", required: true, fullWidth: true, value: accessCode, onChange: (e) => setAccessCode(e.target.value), disabled: submitting })), turnstileRequired && (_jsx(TurnstileWidget, { ref: turnstileWidgetRef, siteKey: authMethods.turnstile_site_key, onToken: setTurnstileToken })), _jsx(Button, { type: "submit", variant: "contained", disabled: submitting || Boolean(providerTransition) || (turnstileRequired && !turnstileToken), children: submitting
|
|
153
|
+
? t('Auth.SIGNUP_SUBMITTING')
|
|
154
|
+
: t('Auth.SIGNUP_SUBMIT') })] })] }));
|
|
155
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// S13: Completes a pending registration with the signed pending-token from the
|
|
3
|
+
// email link and the account's first password. Shared by SignupConfirmPage and
|
|
4
|
+
// embedded flows (UCM-AUTH-14). Success never signs the person in: the host (the
|
|
5
|
+
// page: /login) shows the separate login, which preserves any MFA / login-event
|
|
6
|
+
// flow the app may enforce.
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { Alert, Box, Button, Stack, TextField, Typography, } from '@mui/material';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { confirmRegistration } from '../auth/authApi';
|
|
11
|
+
import { resolveErrorText } from '../utils/resolveErrorText';
|
|
12
|
+
export const SIGNUP_CONFIRM_PAGE_ALERT_SX = { mb: 2 };
|
|
13
|
+
/**
|
|
14
|
+
* Props:
|
|
15
|
+
* - `token`: the pending-registration token (the page reads `?token`).
|
|
16
|
+
* - `onSuccess()`: called without arguments after the registration was confirmed.
|
|
17
|
+
* - `onGoToSignup`, `onGoToLogin`: optional navigation; each button is hidden
|
|
18
|
+
* without its handler.
|
|
19
|
+
* The token and the passwords stay inside this component.
|
|
20
|
+
*/
|
|
21
|
+
export function SignupConfirmContent({ token = '', onSuccess, onGoToSignup, onGoToLogin }) {
|
|
22
|
+
const { t, i18n } = useTranslation();
|
|
23
|
+
const [password, setPassword] = useState('');
|
|
24
|
+
const [confirmPassword, setConfirmPassword] = useState('');
|
|
25
|
+
const [submitting, setSubmitting] = useState(false);
|
|
26
|
+
const [errorKey, setErrorKey] = useState(null);
|
|
27
|
+
const handleSubmit = async (event) => {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
setErrorKey(null);
|
|
30
|
+
if (!token) {
|
|
31
|
+
setErrorKey(t('Auth.PENDING_TOKEN_INVALID'));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (!password || password.length < 8) {
|
|
35
|
+
setErrorKey(t('Auth.PASSWORD_TOO_SHORT'));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (password !== confirmPassword) {
|
|
39
|
+
setErrorKey(t('Auth.PASSWORD_MISMATCH'));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setSubmitting(true);
|
|
43
|
+
try {
|
|
44
|
+
await confirmRegistration({ token, password });
|
|
45
|
+
setPassword('');
|
|
46
|
+
setConfirmPassword('');
|
|
47
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
setErrorKey(resolveErrorText(i18n, err, 'Auth.PENDING_TOKEN_INVALID'));
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
setSubmitting(false);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
if (!token) {
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsx(Alert, { severity: "error", sx: SIGNUP_CONFIRM_PAGE_ALERT_SX, children: t('Auth.PENDING_TOKEN_INVALID', 'This confirmation link is invalid or expired.') }), (onGoToSignup || onGoToLogin) && (_jsxs(Stack, { direction: "row", spacing: 1, sx: { mt: 1 }, children: [onGoToSignup && (_jsx(Button, { onClick: onGoToSignup, variant: "contained", children: t('Auth.SIGNUP_REQUEST_NEW', 'Request a new invitation') })), onGoToLogin && (_jsx(Button, { onClick: onGoToLogin, variant: "text", children: t('Auth.SIGNUP_GO_TO_LOGIN', 'Go to login') }))] }))] }));
|
|
58
|
+
}
|
|
59
|
+
return (_jsxs(_Fragment, { children: [errorKey && (_jsx(Alert, { severity: "error", sx: SIGNUP_CONFIRM_PAGE_ALERT_SX, children: errorKey })), _jsxs(Box, { component: "form", onSubmit: handleSubmit, sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(TextField, { label: t('Auth.NEW_PASSWORD_LABEL', 'New password'), type: "password", required: true, fullWidth: true, value: password, onChange: (e) => setPassword(e.target.value), disabled: submitting, autoComplete: "new-password" }), _jsx(TextField, { label: t('Auth.PASSWORD_CONFIRM_LABEL', 'Confirm new password'), type: "password", required: true, fullWidth: true, value: confirmPassword, onChange: (e) => setConfirmPassword(e.target.value), disabled: submitting, autoComplete: "new-password" }), _jsx(Button, { type: "submit", variant: "contained", disabled: submitting, children: submitting
|
|
60
|
+
? t('Auth.SIGNUP_CONFIRM_SUBMITTING', 'Confirming…')
|
|
61
|
+
: t('Auth.SIGNUP_CONFIRM_SUBMIT', 'Confirm registration') })] }), onGoToLogin && (_jsxs(Stack, { direction: "row", spacing: 1, sx: { mt: 3 }, children: [_jsx(Typography, { variant: "body2", children: t('Auth.SIGNUP_ALREADY_HAVE_ACCOUNT', 'Already have an account?') }), _jsx(Button, { onClick: onGoToLogin, variant: "text", size: "small", children: t('Auth.SIGNUP_GO_TO_LOGIN', 'Go to login') })] }))] }));
|
|
62
|
+
}
|
|
@@ -2592,5 +2592,101 @@ export const authTranslations = {
|
|
|
2592
2592
|
"fr": "Le code saisi est incorrect.",
|
|
2593
2593
|
"en": "The code you entered is incorrect.",
|
|
2594
2594
|
"sw": "Msimbo uliouweka si sahihi."
|
|
2595
|
+
},
|
|
2596
|
+
"Auth.PROVIDER_TRANSITION": {
|
|
2597
|
+
"de": "Die Anmeldung erfolgt bei {{provider}}. Danach geht es hier weiter.",
|
|
2598
|
+
"de_informal": "Die Anmeldung erfolgt bei {{provider}}. Danach geht es hier weiter.",
|
|
2599
|
+
"fr": "La connexion se poursuit auprès de {{provider}}. Vous reviendrez ici ensuite.",
|
|
2600
|
+
"en": "Sign-in continues with {{provider}}. You’ll return here afterwards.",
|
|
2601
|
+
"sw": "Kuingia kunaendelea kupitia {{provider}}. Utarudi hapa baadaye."
|
|
2602
|
+
},
|
|
2603
|
+
"Auth.CONFIRMATION_EMAIL_INSTRUCTION": {
|
|
2604
|
+
"de": "Öffnen Sie den Bestätigungslink in der E-Mail.",
|
|
2605
|
+
"de_informal": "Öffne den Bestätigungslink in der E-Mail.",
|
|
2606
|
+
"fr": "Ouvrez le lien de confirmation reçu par e-mail.",
|
|
2607
|
+
"en": "Open the confirmation link in your email.",
|
|
2608
|
+
"sw": "Fungua kiungo cha uthibitisho kwenye barua pepe yako."
|
|
2609
|
+
},
|
|
2610
|
+
"Auth.TERMS_PRIVACY_PREFIX": {
|
|
2611
|
+
"de": "Ich akzeptiere die ",
|
|
2612
|
+
"fr": "J’accepte les ",
|
|
2613
|
+
"en": "I accept the ",
|
|
2614
|
+
"sw": "Ninakubali "
|
|
2615
|
+
},
|
|
2616
|
+
"Auth.TERMS_LINK_LABEL": {
|
|
2617
|
+
"de": "Nutzungsbedingungen",
|
|
2618
|
+
"fr": "conditions d’utilisation",
|
|
2619
|
+
"en": "terms of use",
|
|
2620
|
+
"sw": "masharti ya matumizi"
|
|
2621
|
+
},
|
|
2622
|
+
"Auth.TERMS_PRIVACY_AND": {
|
|
2623
|
+
"de": " und die ",
|
|
2624
|
+
"fr": " et la ",
|
|
2625
|
+
"en": " and the ",
|
|
2626
|
+
"sw": " na "
|
|
2627
|
+
},
|
|
2628
|
+
"Auth.PRIVACY_LINK_LABEL": {
|
|
2629
|
+
"de": "Datenschutzerklärung",
|
|
2630
|
+
"fr": "politique de confidentialité",
|
|
2631
|
+
"en": "privacy statement",
|
|
2632
|
+
"sw": "taarifa ya faragha"
|
|
2633
|
+
},
|
|
2634
|
+
"Auth.TERMS_PRIVACY_SUFFIX": {
|
|
2635
|
+
"de": ".",
|
|
2636
|
+
"fr": ".",
|
|
2637
|
+
"en": ".",
|
|
2638
|
+
"sw": "."
|
|
2639
|
+
},
|
|
2640
|
+
"Auth.PRIVACY_REQUIRED_LABEL": {
|
|
2641
|
+
"de": "Ich akzeptiere die",
|
|
2642
|
+
"fr": "J’accepte la",
|
|
2643
|
+
"en": "I accept the",
|
|
2644
|
+
"sw": "Ninakubali"
|
|
2645
|
+
},
|
|
2646
|
+
"Auth.CONVENIENCE_COOKIES_LABEL": {
|
|
2647
|
+
"de": "Komfort-Cookies erlauben (optional)",
|
|
2648
|
+
"fr": "Autoriser les cookies de confort (facultatif)",
|
|
2649
|
+
"en": "Allow convenience cookies (optional)",
|
|
2650
|
+
"sw": "Ruhusu vidakuzi vya urahisi (hiari)"
|
|
2651
|
+
},
|
|
2652
|
+
"Auth.PROFILE_NAME_REQUIRED": {
|
|
2653
|
+
"de": "Bitte geben Sie Vor- und Nachnamen an.",
|
|
2654
|
+
"de_informal": "Bitte gib deinen Vor- und Nachnamen an.",
|
|
2655
|
+
"fr": "Veuillez indiquer votre prénom et votre nom.",
|
|
2656
|
+
"en": "Please enter your first and last name.",
|
|
2657
|
+
"sw": "Tafadhali weka jina lako la kwanza na la mwisho."
|
|
2658
|
+
},
|
|
2659
|
+
"Auth.TERMS_PRIVACY_REQUIRED": {
|
|
2660
|
+
"de": "Bitte akzeptieren Sie die Nutzungsbedingungen und die Datenschutzerklärung.",
|
|
2661
|
+
"de_informal": "Bitte akzeptiere die Nutzungsbedingungen und die Datenschutzerklärung.",
|
|
2662
|
+
"fr": "Veuillez accepter les conditions d’utilisation et la politique de confidentialité.",
|
|
2663
|
+
"en": "Please accept the terms of use and the privacy statement.",
|
|
2664
|
+
"sw": "Tafadhali kubali masharti ya matumizi na taarifa ya faragha."
|
|
2665
|
+
},
|
|
2666
|
+
"Auth.PRIVACY_REQUIRED": {
|
|
2667
|
+
"de": "Bitte akzeptieren Sie die Datenschutzerklärung.",
|
|
2668
|
+
"de_informal": "Bitte akzeptiere die Datenschutzerklärung.",
|
|
2669
|
+
"fr": "Veuillez accepter la politique de confidentialité.",
|
|
2670
|
+
"en": "Please accept the privacy statement.",
|
|
2671
|
+
"sw": "Tafadhali kubali taarifa ya faragha."
|
|
2672
|
+
},
|
|
2673
|
+
"Auth.TERMS_LOAD_FAILED": {
|
|
2674
|
+
"de": "Die aktuellen Nutzungsbedingungen konnten nicht geladen werden.",
|
|
2675
|
+
"fr": "Les conditions d’utilisation actuelles n’ont pas pu être chargées.",
|
|
2676
|
+
"en": "The current terms of use could not be loaded.",
|
|
2677
|
+
"sw": "Masharti ya sasa ya matumizi hayakuweza kupakiwa."
|
|
2678
|
+
},
|
|
2679
|
+
"Auth.TERMS_ACCEPTANCE_FAILED": {
|
|
2680
|
+
"de": "Die Zustimmung zu den Nutzungsbedingungen konnte nicht gespeichert werden.",
|
|
2681
|
+
"fr": "L’acceptation des conditions d’utilisation n’a pas pu être enregistrée.",
|
|
2682
|
+
"en": "Your acceptance of the terms of use could not be saved.",
|
|
2683
|
+
"sw": "Kukubali kwako masharti ya matumizi hakukuweza kuhifadhiwa."
|
|
2684
|
+
},
|
|
2685
|
+
"Auth.TERMS_VERSION_CHANGED": {
|
|
2686
|
+
"de": "Die Nutzungsbedingungen wurden aktualisiert. Bitte akzeptieren Sie die aktuelle Fassung.",
|
|
2687
|
+
"de_informal": "Die Nutzungsbedingungen wurden aktualisiert. Bitte akzeptiere die aktuelle Fassung.",
|
|
2688
|
+
"fr": "Les conditions d’utilisation ont été mises à jour. Veuillez accepter la version actuelle.",
|
|
2689
|
+
"en": "The terms of use have been updated. Please accept the current version.",
|
|
2690
|
+
"sw": "Masharti ya matumizi yamesasishwa. Tafadhali kubali toleo la sasa."
|
|
2595
2691
|
}
|
|
2596
2692
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export const onboardingTranslations = {
|
|
2
2
|
'Onboarding.SETUP': { de: 'Einrichtung', fr: 'Configuration', en: 'Setup', sw: 'Usanidi' },
|
|
3
3
|
'Onboarding.STEP_COUNTER': { de: 'Schritt {{current}} von {{total}}', fr: 'Étape {{current}} sur {{total}}', en: 'Step {{current}} of {{total}}', sw: 'Hatua ya {{current}} kati ya {{total}}' },
|
|
4
|
+
'Onboarding.COMPLETED': { de: 'abgeschlossen', fr: 'terminé', en: 'completed', sw: 'imekamilika' },
|
|
5
|
+
'Onboarding.BACK': { de: 'Zurück', fr: 'Retour', en: 'Back', sw: 'Rudi' },
|
|
4
6
|
'Onboarding.PRIVACY_COOKIES_TITLE': { de: 'Datenschutz & Cookies', fr: 'Confidentialité et cookies', en: 'Privacy & cookies', sw: 'Faragha na vidakuzi' },
|
|
5
7
|
'Onboarding.PRIVACY_COOKIES_BODY': { de: 'Bitte lies unsere Datenschutzerklärung und stimme ihr zu, um fortzufahren. Optionale Cookies helfen uns, deine Einstellungen und Präferenzen zu speichern.', fr: 'Veuillez lire et accepter notre politique de confidentialité pour continuer. Les cookies facultatifs nous aident à enregistrer vos réglages et préférences.', en: 'Please read and agree to our privacy statement to continue. Optional cookies help us save your settings and preferences.', sw: 'Tafadhali soma na ukubali taarifa yetu ya faragha ili kuendelea. Vidakuzi vya hiari hutusaidia kuhifadhi mipangilio na mapendeleo yako.' },
|
|
6
8
|
'Onboarding.PRIVACY_AGREEMENT_LABEL': { de: 'Ich habe die Datenschutzerklärung gelesen und stimme ihr zu.', fr: 'J’ai lu et j’accepte la politique de confidentialité.', en: 'I have read and agree to the privacy statement.', sw: 'Nimesoma na ninakubali taarifa ya faragha.' },
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import './theme/fonts';
|
|
|
8
8
|
export { createAppTheme, assertThemeComplete, assertKitSxDisjoint, calculateContrastRatio, KIT_COMPONENT_SX_REGISTRY, reportOffPaletteColours, reportKitSxBypasses, reportRedundantThemeValues, reportThemeAdoption, THEME_COMPLETENESS_SURFACES, } from './theme';
|
|
9
9
|
// --- 0.1 Consumer integration ---
|
|
10
10
|
export { checkKitIntegration } from './testing/checkKitIntegration';
|
|
11
|
+
export { installChunkLoadRecovery, isChunkLoadError } from './utils/chunkLoadRecovery';
|
|
11
12
|
// --- 1. Auth Context (Essentiell für den Wrapper) ---
|
|
12
13
|
export { AuthContext, AuthProvider } from './auth/AuthContext';
|
|
13
14
|
export { UserMenu } from './auth/UserMenu';
|
|
@@ -30,6 +31,10 @@ export { SignupConfirmPage } from './pages/SignupConfirmPage';
|
|
|
30
31
|
export { AccountPage } from './pages/AccountPage';
|
|
31
32
|
// --- 5. Components (Wiederverwendbare UI-Teile) ---
|
|
32
33
|
export { ProfileComponent } from './components/ProfileComponent';
|
|
34
|
+
export { SignUpContent } from './components/SignUpContent';
|
|
35
|
+
export { SignupConfirmContent } from './components/SignupConfirmContent';
|
|
36
|
+
export { LoginContent } from './components/LoginContent';
|
|
37
|
+
export { ProfileStepContent } from './components/ProfileStepContent';
|
|
33
38
|
export { AccessCodeManager } from './components/AccessCodeManager';
|
|
34
39
|
export { UserListComponent } from './components/UserListComponent';
|
|
35
40
|
export { UserInviteComponent } from './components/UserInviteComponent';
|
|
@@ -56,7 +61,8 @@ export { useBillingUsersColumn } from './billing/useBillingUsersColumn';
|
|
|
56
61
|
export { useOperatorAccounts } from './billing/useOperatorAccounts';
|
|
57
62
|
export { WithdrawalDialog } from './billing/WithdrawalDialog';
|
|
58
63
|
export { useBilling } from './billing/useBilling';
|
|
59
|
-
export { createBillingApi, defaultBillingApi } from './billing/api';
|
|
64
|
+
export { createBillingApi, createCheckoutIdempotencyKey, defaultBillingApi } from './billing/api';
|
|
65
|
+
export { createTermsApi, defaultTermsApi } from './auth/termsApi';
|
|
60
66
|
// --- 6. Charts ---
|
|
61
67
|
export { getNeutralChartPalette, useNeutralChartPalette } from './components/charts/palette';
|
|
62
68
|
export { formatShortTime, formatShortDate, formatShortMonth, formatShortYear, } from './components/charts/chartLabels';
|
|
@@ -93,6 +99,7 @@ export * from './onboarding/api';
|
|
|
93
99
|
export { selectActiveSteps } from './onboarding/stepSelection';
|
|
94
100
|
export { OnboardingContext, OnboardingProvider, UNIVERSAL_STEP_DESCRIPTORS, useOnboarding, } from './onboarding/OnboardingProvider';
|
|
95
101
|
export { OnboardingWizard } from './onboarding/OnboardingWizard';
|
|
102
|
+
export { SetupWizardShell } from './onboarding/SetupWizardShell';
|
|
96
103
|
export { CookieConsentStep } from './onboarding/steps/CookieConsentStep';
|
|
97
104
|
export { CompleteNameStep } from './onboarding/steps/CompleteNameStep';
|
|
98
105
|
export { BrowserPushStep } from './onboarding/steps/BrowserPushStep';
|