hazo_auth 10.25.0 → 10.26.2
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/cli-src/lib/already_logged_in_config.server.ts +13 -0
- package/cli-src/lib/login_config.server.ts +3 -0
- package/dist/components/layouts/legal/legal_acceptance_gate.d.ts +1 -1
- package/dist/components/layouts/legal/legal_acceptance_gate.d.ts.map +1 -1
- package/dist/components/layouts/legal/legal_acceptance_gate.js +5 -3
- package/dist/components/layouts/login/index.d.ts +8 -1
- package/dist/components/layouts/login/index.d.ts.map +1 -1
- package/dist/components/layouts/login/index.js +2 -2
- package/dist/components/layouts/register/index.d.ts.map +1 -1
- package/dist/components/layouts/register/index.js +6 -1
- package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts +8 -1
- package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/already_logged_in_guard.js +15 -1
- package/dist/components/layouts/user_management/components/user_signup_stats_cards.d.ts +1 -8
- package/dist/components/layouts/user_management/components/user_signup_stats_cards.d.ts.map +1 -1
- package/dist/components/layouts/user_management/components/user_signup_stats_cards.js +8 -90
- package/dist/lib/already_logged_in_config.server.d.ts +8 -0
- package/dist/lib/already_logged_in_config.server.d.ts.map +1 -1
- package/dist/lib/already_logged_in_config.server.js +4 -0
- package/dist/lib/login_config.server.d.ts +2 -0
- package/dist/lib/login_config.server.d.ts.map +1 -1
- package/dist/lib/login_config.server.js +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/server_pages/login.d.ts.map +1 -1
- package/dist/server_pages/login.js +1 -1
- package/dist/server_pages/login_client_wrapper.d.ts +1 -1
- package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
- package/dist/server_pages/login_client_wrapper.js +2 -2
- package/package.json +10 -10
|
@@ -14,6 +14,14 @@ export type AlreadyLoggedInConfig = {
|
|
|
14
14
|
/** Undefined when not configured — components fall back to their own i18n `t()` default. */
|
|
15
15
|
returnHomeButtonLabel: string | undefined;
|
|
16
16
|
returnHomePath: string;
|
|
17
|
+
/**
|
|
18
|
+
* When set, an already-authenticated user who lands on an auth page (login,
|
|
19
|
+
* register, forgot/reset password, email verification) is sent straight to
|
|
20
|
+
* this path instead of seeing the "already logged in" message + buttons.
|
|
21
|
+
* Undefined when not configured (default) — preserves the existing
|
|
22
|
+
* message/logout/return-home UX unchanged.
|
|
23
|
+
*/
|
|
24
|
+
redirectPath: string | undefined;
|
|
17
25
|
};
|
|
18
26
|
|
|
19
27
|
// section: helpers
|
|
@@ -42,12 +50,17 @@ export function get_already_logged_in_config(): AlreadyLoggedInConfig {
|
|
|
42
50
|
// Read return home path (defaults to "/")
|
|
43
51
|
const returnHomePath = get_config_value(section, "return_home_path", "/");
|
|
44
52
|
|
|
53
|
+
// Read redirect path — undefined when not configured, so the guard keeps
|
|
54
|
+
// showing the message + buttons (back-compat default, opt-in feature).
|
|
55
|
+
const redirectPath = get_config_value_optional(section, "redirect_path");
|
|
56
|
+
|
|
45
57
|
return {
|
|
46
58
|
message,
|
|
47
59
|
showLogoutButton,
|
|
48
60
|
showReturnHomeButton,
|
|
49
61
|
returnHomeButtonLabel,
|
|
50
62
|
returnHomePath,
|
|
63
|
+
redirectPath,
|
|
51
64
|
};
|
|
52
65
|
}
|
|
53
66
|
|
|
@@ -24,6 +24,8 @@ export type LoginConfig = {
|
|
|
24
24
|
showReturnHomeButton: boolean;
|
|
25
25
|
returnHomeButtonLabel: string | undefined;
|
|
26
26
|
returnHomePath: string;
|
|
27
|
+
/** See `AlreadyLoggedInConfig.redirectPath` — undefined unless `[hazo_auth__already_logged_in] redirect_path` is set. */
|
|
28
|
+
alreadyLoggedInRedirectPath: string | undefined;
|
|
27
29
|
forgotPasswordPath: string;
|
|
28
30
|
/** Undefined when not configured — falls back to `t("login.forgot_password_link_default")`. "" hides the link. */
|
|
29
31
|
forgotPasswordLabel: string | undefined;
|
|
@@ -106,6 +108,7 @@ export function get_login_config(): LoginConfig {
|
|
|
106
108
|
showReturnHomeButton: alreadyLoggedInConfig.showReturnHomeButton,
|
|
107
109
|
returnHomeButtonLabel: alreadyLoggedInConfig.returnHomeButtonLabel,
|
|
108
110
|
returnHomePath: alreadyLoggedInConfig.returnHomePath,
|
|
111
|
+
alreadyLoggedInRedirectPath: alreadyLoggedInConfig.redirectPath,
|
|
109
112
|
forgotPasswordPath,
|
|
110
113
|
forgotPasswordLabel,
|
|
111
114
|
createAccountPath,
|
|
@@ -2,6 +2,6 @@ interface LegalAcceptanceGateProps {
|
|
|
2
2
|
children: React.ReactNode;
|
|
3
3
|
apiBasePath?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function LegalAcceptanceGate({ children, apiBasePath }: LegalAcceptanceGateProps): import("react").JSX.Element
|
|
5
|
+
export declare function LegalAcceptanceGate({ children, apiBasePath }: LegalAcceptanceGateProps): import("react").JSX.Element;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=legal_acceptance_gate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal_acceptance_gate.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/legal/legal_acceptance_gate.tsx"],"names":[],"mappings":"AASA,UAAU,wBAAwB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,WAA8B,EAAE,EAAE,wBAAwB
|
|
1
|
+
{"version":3,"file":"legal_acceptance_gate.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/legal/legal_acceptance_gate.tsx"],"names":[],"mappings":"AASA,UAAU,wBAAwB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,WAA8B,EAAE,EAAE,wBAAwB,+BA4HzG"}
|
|
@@ -77,9 +77,11 @@ export function LegalAcceptanceGate({ children, apiBasePath = '/api/hazo_auth' }
|
|
|
77
77
|
set_submitting(false);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
// Fail open: render children immediately while the check is in flight (SSR and
|
|
81
|
+
// first client paint both start in 'loading', since the fetch only happens inside
|
|
82
|
+
// useEffect) and once it resolves 'clear'. Only the genuine 'required' status below
|
|
83
|
+
// blocks the tree — never the undetermined state. See CHANGE_LOG.md.
|
|
84
|
+
if (gate.status === 'loading' || gate.status === 'clear')
|
|
83
85
|
return _jsx(_Fragment, { children: children });
|
|
84
86
|
const all_accepted = gate.docs.every((doc) => accepted[doc.key]);
|
|
85
87
|
return (_jsx("div", { className: "min-h-screen flex items-center justify-center p-4", children: _jsxs("div", { className: "w-full max-w-lg space-y-6", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold", children: t("legal.gate.heading") }), _jsx("p", { className: "text-muted-foreground mt-1", children: t("legal.gate.description") })] }), gate.display_mode === 'combined' ? (_jsx(LegalDocCombinedView, { docs: gate.docs, accepted: gate.docs.length > 0 && gate.docs.every((d) => accepted[d.key]), onAcceptedChange: (value) => gate.docs.forEach((doc) => set_accepted((prev) => (Object.assign(Object.assign({}, prev), { [doc.key]: value })))) })) : (_jsx(LegalDocCheckboxList, { docs: gate.docs, accepted: accepted, onAcceptedChange: (key, value) => set_accepted((prev) => (Object.assign(Object.assign({}, prev), { [key]: value }))) })), error && _jsx("p", { className: "text-destructive text-sm", children: error }), _jsx(Button, { onClick: handle_submit, disabled: !all_accepted || submitting, className: "w-full", children: submitting ? t("legal.gate.saving") : t("legal.gate.continue_button") })] }) }));
|
|
@@ -38,6 +38,13 @@ export type LoginLayoutProps<TClient = unknown> = {
|
|
|
38
38
|
showReturnHomeButton?: boolean;
|
|
39
39
|
returnHomeButtonLabel?: string;
|
|
40
40
|
returnHomePath?: string;
|
|
41
|
+
/**
|
|
42
|
+
* When set, an already-authenticated user is sent straight to this path
|
|
43
|
+
* instead of seeing the "already logged in" message. See
|
|
44
|
+
* `AlreadyLoggedInGuard`'s `redirectPath` prop. Ignored in `form_only`
|
|
45
|
+
* mode (the guard is skipped there entirely).
|
|
46
|
+
*/
|
|
47
|
+
alreadyLoggedInRedirectPath?: string;
|
|
41
48
|
forgot_password_path?: string;
|
|
42
49
|
forgot_password_label?: string;
|
|
43
50
|
create_account_path?: string;
|
|
@@ -64,5 +71,5 @@ export type LoginLayoutProps<TClient = unknown> = {
|
|
|
64
71
|
*/
|
|
65
72
|
layout?: "two_column" | "form_only";
|
|
66
73
|
};
|
|
67
|
-
export default function login_layout<TClient>({ image_src, image_alt, image_background_color, field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgot_password_path, forgot_password_label, create_account_path, create_account_label, show_create_account_link, urlOnLogon, oauth, layout, default_values, }: LoginLayoutProps<TClient>): import("react").JSX.Element;
|
|
74
|
+
export default function login_layout<TClient>({ image_src, image_alt, image_background_color, field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, alreadyLoggedInRedirectPath, forgot_password_path, forgot_password_label, create_account_path, create_account_label, show_create_account_link, urlOnLogon, oauth, layout, default_values, }: LoginLayoutProps<TClient>): import("react").JSX.Element;
|
|
68
75
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/login/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAYlD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAW/C,OAAO,EAA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EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqB,EACrB,cAAoB,EACpB,2BAA2B,EAC3B,oBAAmD,EACnD,qBAAqB,EACrB,mBAA2C,EAC3C,oBAAoB,EACpB,wBAA+B,EAC/B,UAAU,EACV,KAAK,EACL,MAAqB,EACrB,cAAc,GACf,EAAE,gBAAgB,CAAC,OAAO,CAAC,+BAkS3B"}
|
|
@@ -24,7 +24,7 @@ const ORDERED_FIELDS = [
|
|
|
24
24
|
LOGIN_FIELD_IDS.PASSWORD,
|
|
25
25
|
];
|
|
26
26
|
// section: component
|
|
27
|
-
export default function login_layout({ image_src, image_alt, image_background_color = "#f1f5f9", field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel, returnHomePath = "/", forgot_password_path = "/hazo_auth/forgot_password", forgot_password_label, create_account_path = "/hazo_auth/register", create_account_label, show_create_account_link = true, urlOnLogon, oauth, layout = "two_column", default_values, }) {
|
|
27
|
+
export default function login_layout({ image_src, image_alt, image_background_color = "#f1f5f9", field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel, returnHomePath = "/", alreadyLoggedInRedirectPath, forgot_password_path = "/hazo_auth/forgot_password", forgot_password_label, create_account_path = "/hazo_auth/register", create_account_label, show_create_account_link = true, urlOnLogon, oauth, layout = "two_column", default_values, }) {
|
|
28
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
29
29
|
const t = useAuthT();
|
|
30
30
|
const resolvedSuccessMessage = successMessage !== null && successMessage !== void 0 ? successMessage : t("login.success_message_default");
|
|
@@ -126,7 +126,7 @@ export default function login_layout({ image_src, image_alt, image_background_co
|
|
|
126
126
|
return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: successContent }));
|
|
127
127
|
}
|
|
128
128
|
// Two-column mode (default): main flow with already-logged-in guard.
|
|
129
|
-
return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: resolvedAlreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: mainContent }) }));
|
|
129
|
+
return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: resolvedAlreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, redirectPath: alreadyLoggedInRedirectPath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: mainContent }) }));
|
|
130
130
|
}
|
|
131
131
|
// Same-origin path validator for the `?redirect=` query param. Accepts
|
|
132
132
|
// values like "/foo" or "/foo?bar". Rejects anything that could redirect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/register/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAY/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CA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IAC1B,qGAAqG;IACrG,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,gFAAgF;IAChF,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC/C,CAAC;AAkBF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,EAC/C,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,eAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqB,EACrB,cAAoB,EACpB,UAA+B,EAC/B,WAAW,EACX,UAAU,EACV,KAAK,EACL,MAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,EAAE,mBAAmB,CAAC,OAAO,CAAC,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/register/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAY/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAGlF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gCAAgC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wHAAwH;IACxH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wIAAwI;IACxI,kBAAkB,CAAC,EAAE,MAAM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AClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,eAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqB,EACrB,cAAoB,EACpB,UAA+B,EAC/B,WAAW,EACX,UAAU,EACV,KAAK,EACL,MAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,EAAE,mBAAmB,CAAC,OAAO,CAAC,+BAwW9B"}
|
|
@@ -148,8 +148,13 @@ export default function register_layout({ image_src, image_alt, image_background
|
|
|
148
148
|
const mainContent = (_jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), oauthError && (_jsxs("div", { className: "cls_register_layout_oauth_error flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700", children: [_jsx(AlertCircle, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: getOAuthErrorMessage(oauthError) })] })), oauthConfig.enable_google && (_jsx("div", { className: "cls_register_layout_oauth_section", children: _jsx(GoogleSignInButton, { label: oauthConfig.google_button_text, callbackUrl: oauthCallbackUrl }) })), oauthConfig.enable_facebook_oauth && (_jsx("div", { className: "cls_register_layout_facebook_section", children: _jsx(FacebookSignInButton, { label: oauthConfig.facebook_button_text || t("shared.oauth.facebook_button_default"), callbackUrl: "/api/hazo_auth/oauth/facebook/callback" }) })), (oauthConfig.enable_google || oauthConfig.enable_facebook_oauth) && oauthConfig.enable_email_password && (_jsx(OAuthDivider, { text: oauthConfig.oauth_divider_text })), oauthConfig.enable_email_password && (_jsxs("form", { className: "cls_register_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": t("register.aria.form"), children: [renderFields(form), renderLocationAndCustomFields(), legal_docs.length > 0 && (_jsx("div", { className: "space-y-2", children: legal_display_mode === 'combined' ? (_jsx(LegalDocCombinedView, { docs: legal_docs, accepted: legal_docs.every(doc => form.legal_accepted[doc.key]), onAcceptedChange: (value) => legal_docs.forEach(doc => form.handleLegalAcceptedChange(doc.key, value)) })) : (_jsx(LegalDocCheckboxList, { docs: legal_docs, accepted: form.legal_accepted, onAcceptedChange: form.handleLegalAcceptedChange })) })), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: t("register.aria.submit"), cancelAriaLabel: t("register.aria.cancel") }), _jsxs("div", { className: "cls_register_layout_sign_in_link flex items-center justify-center gap-1 text-sm text-muted-foreground", children: [_jsx("span", { children: t("register.sign_in_prompt") }), _jsx(Link, { href: signInPath, className: "cls_register_layout_sign_in_link_text text-primary underline-offset-4 hover:underline", "aria-label": t("register.aria.sign_in_link"), children: resolvedSignInLabel })] }), form.isSubmitting && (_jsx("div", { className: "cls_register_submitting_indicator text-sm text-slate-600 text-center", children: t("register.submitting_indicator") }))] })), !oauthConfig.enable_email_password && (oauthConfig.enable_google || oauthConfig.enable_facebook_oauth) && (_jsxs("div", { className: "cls_register_layout_sign_in_link mt-4 flex items-center justify-center gap-1 text-sm text-muted-foreground", children: [_jsx("span", { children: t("register.sign_in_prompt") }), _jsx(Link, { href: signInPath, className: "cls_register_layout_sign_in_link_text text-primary underline-offset-4 hover:underline", "aria-label": t("register.aria.sign_in_link"), children: resolvedSignInLabel })] }))] }));
|
|
149
149
|
// form_only mode: emit just the form content. See login_layout for the
|
|
150
150
|
// rationale; AlreadyLoggedInGuard is intentionally skipped here.
|
|
151
|
+
// The wrapper below mirrors TwoColumnAuthLayout's own form container
|
|
152
|
+
// (`cls_two_column_auth_layout_form_inner`, `max-w-sm`) — without it the
|
|
153
|
+
// form floats at its natural width inside the consumer's centered flex
|
|
154
|
+
// chrome, drifting right with excess whitespace on the left instead of
|
|
155
|
+
// rendering as a centered, width-constrained column.
|
|
151
156
|
if (layout === "form_only") {
|
|
152
|
-
return mainContent;
|
|
157
|
+
return (_jsx("div", { className: "cls_register_layout_form_only_container mx-auto flex w-full max-w-sm flex-col gap-6", children: mainContent }));
|
|
153
158
|
}
|
|
154
159
|
return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: resolvedAlreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: mainContent }) }));
|
|
155
160
|
}
|
|
@@ -9,6 +9,13 @@ export type AlreadyLoggedInGuardProps = {
|
|
|
9
9
|
returnHomeButtonLabel?: string;
|
|
10
10
|
returnHomePath?: string;
|
|
11
11
|
requireEmailVerified?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* When set, skip the "already logged in" message/buttons entirely and
|
|
14
|
+
* `router.replace()` straight to this path (e.g. `/dashboard`). A brief
|
|
15
|
+
* loading placeholder renders while the redirect is in flight. Undefined
|
|
16
|
+
* (default) preserves the existing message + logout/return-home UX.
|
|
17
|
+
*/
|
|
18
|
+
redirectPath?: string;
|
|
12
19
|
children: React.ReactNode;
|
|
13
20
|
};
|
|
14
21
|
/**
|
|
@@ -17,5 +24,5 @@ export type AlreadyLoggedInGuardProps = {
|
|
|
17
24
|
* @param props - Component props including layout config and message customization
|
|
18
25
|
* @returns Either the "already logged in" UI or the children
|
|
19
26
|
*/
|
|
20
|
-
export declare function AlreadyLoggedInGuard({ image_src, image_alt, image_background_color, message, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, requireEmailVerified, children, }: AlreadyLoggedInGuardProps): import("react").JSX.Element;
|
|
27
|
+
export declare function AlreadyLoggedInGuard({ image_src, image_alt, image_background_color, message, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, requireEmailVerified, redirectPath, children, }: AlreadyLoggedInGuardProps): import("react").JSX.Element;
|
|
21
28
|
//# sourceMappingURL=already_logged_in_guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"already_logged_in_guard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/already_logged_in_guard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"already_logged_in_guard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/already_logged_in_guard.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,OAAO,EACP,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqB,EACrB,cAAoB,EACpB,oBAA4B,EAC5B,YAAY,EACZ,QAAQ,GACT,EAAE,yBAAyB,+BAwE3B"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
5
|
// section: imports
|
|
6
|
+
import { useEffect } from "react";
|
|
6
7
|
import { use_auth_status } from "../hooks/use_auth_status.js";
|
|
7
8
|
import { LogoutButton } from "./logout_button.js";
|
|
8
9
|
import { Button } from "../../../ui/button.js";
|
|
@@ -17,7 +18,7 @@ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
|
|
|
17
18
|
* @param props - Component props including layout config and message customization
|
|
18
19
|
* @returns Either the "already logged in" UI or the children
|
|
19
20
|
*/
|
|
20
|
-
export function AlreadyLoggedInGuard({ image_src, image_alt, image_background_color = "#f1f5f9", message, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel, returnHomePath = "/", requireEmailVerified = false, children, }) {
|
|
21
|
+
export function AlreadyLoggedInGuard({ image_src, image_alt, image_background_color = "#f1f5f9", message, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel, returnHomePath = "/", requireEmailVerified = false, redirectPath, children, }) {
|
|
21
22
|
const t = useAuthT();
|
|
22
23
|
const resolvedMessage = message !== null && message !== void 0 ? message : t("shared.guard.already_logged_in_message");
|
|
23
24
|
const resolvedReturnHomeButtonLabel = returnHomeButtonLabel !== null && returnHomeButtonLabel !== void 0 ? returnHomeButtonLabel : t("shared.guard.return_home_default");
|
|
@@ -29,6 +30,19 @@ export function AlreadyLoggedInGuard({ image_src, image_alt, image_background_co
|
|
|
29
30
|
const shouldShowAlreadyLoggedIn = authStatus.authenticated &&
|
|
30
31
|
!authStatus.loading &&
|
|
31
32
|
(!requireEmailVerified || authStatus.email_verified === true);
|
|
33
|
+
const shouldRedirect = shouldShowAlreadyLoggedIn && !!redirectPath;
|
|
34
|
+
// Fire the redirect as a side effect (not during render) once we know the
|
|
35
|
+
// user is authenticated. `router.replace` (not `push`) so the auth page
|
|
36
|
+
// never lands in browser history — hitting Back won't bounce the user
|
|
37
|
+
// straight back to it.
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (shouldRedirect && redirectPath) {
|
|
40
|
+
router.replace(redirectPath);
|
|
41
|
+
}
|
|
42
|
+
}, [shouldRedirect, redirectPath, router]);
|
|
43
|
+
if (shouldRedirect) {
|
|
44
|
+
return (_jsx("div", { className: "cls_already_logged_in_guard_redirecting flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: t("shared.guard.loading") }) }));
|
|
45
|
+
}
|
|
32
46
|
if (shouldShowAlreadyLoggedIn) {
|
|
33
47
|
return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_already_logged_in_guard flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx("p", { className: "cls_already_logged_in_guard_message text-lg font-medium text-slate-900", children: resolvedMessage }), _jsxs("div", { className: "cls_already_logged_in_guard_actions flex flex-col gap-3 items-center mt-4", children: [showLogoutButton && (_jsx(LogoutButton, { className: "cls_already_logged_in_guard_logout_button", variant: "default" })), showReturnHomeButton && (_jsxs(Button, { onClick: () => router.push(returnHomePath), variant: "outline", className: "cls_already_logged_in_guard_return_home_button", "aria-label": resolvedReturnHomeButtonLabel, children: [_jsx(Home, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), resolvedReturnHomeButtonLabel] }))] })] }) }));
|
|
34
48
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
export interface UserSignupStatsCardsProps {
|
|
3
2
|
users: ReadonlyArray<{
|
|
4
3
|
created_at?: string | null;
|
|
@@ -7,11 +6,5 @@ export interface UserSignupStatsCardsProps {
|
|
|
7
6
|
now?: Date;
|
|
8
7
|
className?: string;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
* Total + rolling-window signup cards (All time, 7d, 30d, 3mo, 6mo, YTD) each
|
|
12
|
-
* with % change vs the prior equal period, plus a larger interactive YTD
|
|
13
|
-
* monthly bar chart with axes, gridlines, and hover tooltips.
|
|
14
|
-
* Computes everything client-side from the already-loaded users list.
|
|
15
|
-
*/
|
|
16
|
-
export declare function UserSignupStatsCards({ users, now, className }: UserSignupStatsCardsProps): React.JSX.Element;
|
|
9
|
+
export declare function UserSignupStatsCards({ users, now, className }: UserSignupStatsCardsProps): import("react").JSX.Element;
|
|
17
10
|
//# sourceMappingURL=user_signup_stats_cards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user_signup_stats_cards.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/user_management/components/user_signup_stats_cards.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user_signup_stats_cards.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/user_management/components/user_signup_stats_cards.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,aAAa,CAAC;QAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACrD,8DAA8D;IAC9D,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,yBAAyB,+BAexF"}
|
|
@@ -1,94 +1,12 @@
|
|
|
1
|
-
// file_description:
|
|
2
|
-
//
|
|
3
|
-
// signups bar chart (axes, gridlines, hover tooltip) for the top of the Manage
|
|
4
|
-
// Users tab. Pure/dependency-free (inline SVG chart, no chart library).
|
|
1
|
+
// file_description: User signup trend summary for the Manage Users tab.
|
|
2
|
+
// Wraps hazo_ui's TrendSummary with user-specific stat computation.
|
|
5
3
|
"use client";
|
|
6
|
-
import { jsx as _jsx
|
|
7
|
-
import { useMemo
|
|
8
|
-
import {
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { computeTrendStats, TrendSummary } from "hazo_ui";
|
|
9
7
|
import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
|
|
10
|
-
function DeltaBadge({ pct }) {
|
|
11
|
-
const t = useAuthT();
|
|
12
|
-
if (pct === null) {
|
|
13
|
-
return _jsx("span", { className: "text-xs text-muted-foreground", children: "\u2014" });
|
|
14
|
-
}
|
|
15
|
-
const up = pct >= 0;
|
|
16
|
-
const cls = up ? "text-emerald-600" : "text-red-600";
|
|
17
|
-
const arrow = up ? "▲" : "▼";
|
|
18
|
-
return (_jsxs("span", { className: `text-xs font-medium ${cls}`, title: t("user_management.signup_stats.vs_previous"), children: [arrow, " ", up ? "+" : "", pct, "%"] }));
|
|
19
|
-
}
|
|
20
|
-
const STAT_CARD_HEIGHT_PX = 168;
|
|
21
|
-
function StatCard({ w }) {
|
|
22
|
-
const t = useAuthT();
|
|
23
|
-
return (_jsxs("div", { className: "cls_user_signup_stat_card flex min-w-0 flex-col justify-between rounded-lg border bg-card p-4", style: { height: STAT_CARD_HEIGHT_PX }, children: [_jsx("div", { className: "truncate text-xs text-muted-foreground", children: w.label }), _jsxs("div", { className: "flex items-baseline justify-between gap-1", children: [_jsx("span", { className: "text-3xl font-bold tabular-nums", children: w.count.toLocaleString() }), w.key !== "all" && _jsx(DeltaBadge, { pct: w.pctChange })] }), w.key !== "all" && w.prevCount !== null && (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: t("user_management.signup_stats.prev_count", { count: w.prevCount.toLocaleString() }) })), w.key === "all" && (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: t("user_management.signup_stats.total_users") }))] }));
|
|
24
|
-
}
|
|
25
|
-
/** Round a value up to a "nice" axis maximum (1/2/5 * 10^n steps). */
|
|
26
|
-
function niceMax(n) {
|
|
27
|
-
if (n <= 0)
|
|
28
|
-
return 1;
|
|
29
|
-
const exp = Math.floor(Math.log10(n));
|
|
30
|
-
const base = Math.pow(10, exp);
|
|
31
|
-
const frac = n / base;
|
|
32
|
-
let niceFrac;
|
|
33
|
-
if (frac <= 1)
|
|
34
|
-
niceFrac = 1;
|
|
35
|
-
else if (frac <= 2)
|
|
36
|
-
niceFrac = 2;
|
|
37
|
-
else if (frac <= 5)
|
|
38
|
-
niceFrac = 5;
|
|
39
|
-
else
|
|
40
|
-
niceFrac = 10;
|
|
41
|
-
return niceFrac * base;
|
|
42
|
-
}
|
|
43
|
-
function YtdMiniChart({ data }) {
|
|
44
|
-
const t = useAuthT();
|
|
45
|
-
const [hoverIndex, setHoverIndex] = useState(null);
|
|
46
|
-
const total = data.reduce((n, d) => n + d.count, 0);
|
|
47
|
-
const rawMax = Math.max(1, ...data.map((d) => d.count));
|
|
48
|
-
const max = niceMax(rawMax);
|
|
49
|
-
const mid = Math.round(max / 2);
|
|
50
|
-
// Chart geometry. H mirrors the plot area left after the header row + padding
|
|
51
|
-
// are subtracted from STAT_CARD_HEIGHT_PX, so the rendered SVG (stretched via
|
|
52
|
-
// preserveAspectRatio="none") stays close to a 1 viewBox-unit : 1px scale.
|
|
53
|
-
const W = 480;
|
|
54
|
-
const H = 120;
|
|
55
|
-
const marginLeft = 34;
|
|
56
|
-
const marginRight = 8;
|
|
57
|
-
const marginTop = 16;
|
|
58
|
-
const marginBottom = 20;
|
|
59
|
-
const plotW = W - marginLeft - marginRight;
|
|
60
|
-
const plotH = H - marginTop - marginBottom;
|
|
61
|
-
const gap = 6;
|
|
62
|
-
const n = Math.max(1, data.length);
|
|
63
|
-
const colW = plotW / n;
|
|
64
|
-
const bw = Math.max(1, colW - gap);
|
|
65
|
-
const yFor = (value) => marginTop + plotH - (value / max) * plotH;
|
|
66
|
-
const hovered = hoverIndex !== null ? data[hoverIndex] : null;
|
|
67
|
-
return (_jsxs("div", { className: "cls_user_signup_ytd_chart col-span-6 flex min-w-0 flex-col rounded-lg border bg-card p-3", style: { height: STAT_CARD_HEIGHT_PX }, children: [_jsxs("div", { className: "flex shrink-0 items-baseline justify-between", children: [_jsx("div", { className: "truncate text-[11px] text-muted-foreground", children: t("user_management.signup_stats.ytd_title") }), _jsx("div", { className: "text-sm font-semibold tabular-nums", children: total.toLocaleString() })] }), _jsxs("div", { className: "relative mt-2 min-h-0 flex-1", children: [_jsxs("svg", { role: "img", "aria-label": t("user_management.signup_stats.ytd_aria", {
|
|
68
|
-
list: data.map((d) => `${d.label} ${d.count}`).join(", "),
|
|
69
|
-
}), viewBox: `0 0 ${W} ${H}`, preserveAspectRatio: "none", className: "h-full w-full", children: [[0, mid, max].map((tick) => {
|
|
70
|
-
const y = yFor(tick);
|
|
71
|
-
return (_jsxs("g", { children: [_jsx("line", { x1: marginLeft, x2: W - marginRight, y1: y, y2: y, stroke: "currentColor", strokeOpacity: 0.1 }), _jsx("text", { x: marginLeft - 6, y: y, dy: 3, textAnchor: "end", fontSize: 9, className: "fill-muted-foreground", children: tick.toLocaleString() })] }, tick));
|
|
72
|
-
}), _jsx("line", { x1: marginLeft, x2: W - marginRight, y1: marginTop + plotH, y2: marginTop + plotH, stroke: "currentColor", strokeOpacity: 0.2 }), data.map((d, i) => {
|
|
73
|
-
const barH = Math.round((d.count / max) * plotH);
|
|
74
|
-
const colX = marginLeft + i * colW;
|
|
75
|
-
const barX = colX + (colW - bw) / 2;
|
|
76
|
-
const barY = marginTop + plotH - barH;
|
|
77
|
-
const centerX = colX + colW / 2;
|
|
78
|
-
const isDimmed = hoverIndex !== null && hoverIndex !== i;
|
|
79
|
-
return (_jsxs("g", { onMouseEnter: () => setHoverIndex(i), onMouseLeave: () => setHoverIndex(null), children: [_jsx("rect", { x: colX, y: marginTop, width: colW, height: plotH, fill: "transparent" }), _jsx("rect", { x: barX, y: barY, width: bw, height: Math.max(0, barH), rx: 2, className: "fill-primary", fillOpacity: isDimmed ? 0.45 : 1, children: _jsx("title", { children: `${d.label}: ${d.count} ${t("user_management.signup_stats.tooltip_suffix")}` }) }), _jsx("text", { x: centerX, y: barY - 4, textAnchor: "middle", fontSize: 10, fontWeight: 600, className: "fill-foreground", children: d.count }), _jsx("text", { x: centerX, y: marginTop + plotH + 14, textAnchor: "middle", fontSize: 9, className: "fill-muted-foreground", children: d.label })] }, d.label));
|
|
80
|
-
})] }), hovered && hoverIndex !== null && (_jsxs("div", { className: "pointer-events-none absolute z-10 -translate-x-1/2 -translate-y-full rounded-md border bg-popover px-2 py-1 text-[10px] font-medium text-popover-foreground shadow-sm", style: {
|
|
81
|
-
left: `${Math.min(92, Math.max(8, ((marginLeft + hoverIndex * (plotW / n) + plotW / n / 2) / W) * 100))}%`,
|
|
82
|
-
top: `${((marginTop + plotH - (hovered.count / max) * plotH) / H) * 100}%`,
|
|
83
|
-
}, children: [hovered.label, ": ", hovered.count, " ", t("user_management.signup_stats.tooltip_suffix")] }))] })] }));
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Total + rolling-window signup cards (All time, 7d, 30d, 3mo, 6mo, YTD) each
|
|
87
|
-
* with % change vs the prior equal period, plus a larger interactive YTD
|
|
88
|
-
* monthly bar chart with axes, gridlines, and hover tooltips.
|
|
89
|
-
* Computes everything client-side from the already-loaded users list.
|
|
90
|
-
*/
|
|
91
8
|
export function UserSignupStatsCards({ users, now, className }) {
|
|
92
|
-
const
|
|
93
|
-
|
|
9
|
+
const t = useAuthT();
|
|
10
|
+
const stats = useMemo(() => computeTrendStats(users, now), [users, now]);
|
|
11
|
+
return (_jsx(TrendSummary, { windows: stats.windows, chartData: stats.ytdMonthly, chartTitle: t("user_management.signup_stats.ytd_title"), chartTooltipSuffix: t("user_management.signup_stats.tooltip_suffix"), totalLabel: t("user_management.signup_stats.total_users"), prevTemplate: t("user_management.signup_stats.prev_template"), className: className }));
|
|
94
12
|
}
|
|
@@ -7,6 +7,14 @@ export type AlreadyLoggedInConfig = {
|
|
|
7
7
|
/** Undefined when not configured — components fall back to their own i18n `t()` default. */
|
|
8
8
|
returnHomeButtonLabel: string | undefined;
|
|
9
9
|
returnHomePath: string;
|
|
10
|
+
/**
|
|
11
|
+
* When set, an already-authenticated user who lands on an auth page (login,
|
|
12
|
+
* register, forgot/reset password, email verification) is sent straight to
|
|
13
|
+
* this path instead of seeing the "already logged in" message + buttons.
|
|
14
|
+
* Undefined when not configured (default) — preserves the existing
|
|
15
|
+
* message/logout/return-home UX unchanged.
|
|
16
|
+
*/
|
|
17
|
+
redirectPath: string | undefined;
|
|
10
18
|
};
|
|
11
19
|
/**
|
|
12
20
|
* Reads already logged in configuration from hazo_auth_config.ini file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"already_logged_in_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/already_logged_in_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,MAAM,MAAM,qBAAqB,GAAG;IAClC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4FAA4F;IAC5F,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"already_logged_in_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/already_logged_in_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAMrB,MAAM,MAAM,qBAAqB,GAAG;IAClC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4FAA4F;IAC5F,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,qBAAqB,CAgCpE"}
|
|
@@ -23,11 +23,15 @@ export function get_already_logged_in_config() {
|
|
|
23
23
|
const returnHomeButtonLabel = get_config_value_optional(section, "return_home_button_label");
|
|
24
24
|
// Read return home path (defaults to "/")
|
|
25
25
|
const returnHomePath = get_config_value(section, "return_home_path", "/");
|
|
26
|
+
// Read redirect path — undefined when not configured, so the guard keeps
|
|
27
|
+
// showing the message + buttons (back-compat default, opt-in feature).
|
|
28
|
+
const redirectPath = get_config_value_optional(section, "redirect_path");
|
|
26
29
|
return {
|
|
27
30
|
message,
|
|
28
31
|
showLogoutButton,
|
|
29
32
|
showReturnHomeButton,
|
|
30
33
|
returnHomeButtonLabel,
|
|
31
34
|
returnHomePath,
|
|
35
|
+
redirectPath,
|
|
32
36
|
};
|
|
33
37
|
}
|
|
@@ -9,6 +9,8 @@ export type LoginConfig = {
|
|
|
9
9
|
showReturnHomeButton: boolean;
|
|
10
10
|
returnHomeButtonLabel: string | undefined;
|
|
11
11
|
returnHomePath: string;
|
|
12
|
+
/** See `AlreadyLoggedInConfig.redirectPath` — undefined unless `[hazo_auth__already_logged_in] redirect_path` is set. */
|
|
13
|
+
alreadyLoggedInRedirectPath: string | undefined;
|
|
12
14
|
forgotPasswordPath: string;
|
|
13
15
|
/** Undefined when not configured — falls back to `t("login.forgot_password_link_default")`. "" hides the link. */
|
|
14
16
|
forgotPasswordLabel: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login_config.server.d.ts","sourceRoot":"","sources":["../../src/lib/login_config.server.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM3E,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8GAA8G;IAC9G,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kHAAkH;IAClH,mBAAmB,EAAE,MAAM,GAAG,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,WAAW,CAAC;CACpB,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAyE9C"}
|
|
@@ -51,6 +51,7 @@ export function get_login_config() {
|
|
|
51
51
|
showReturnHomeButton: alreadyLoggedInConfig.showReturnHomeButton,
|
|
52
52
|
returnHomeButtonLabel: alreadyLoggedInConfig.returnHomeButtonLabel,
|
|
53
53
|
returnHomePath: alreadyLoggedInConfig.returnHomePath,
|
|
54
|
+
alreadyLoggedInRedirectPath: alreadyLoggedInConfig.redirectPath,
|
|
54
55
|
forgotPasswordPath,
|
|
55
56
|
forgotPasswordLabel,
|
|
56
57
|
createAccountPath,
|
package/dist/locales/en.json
CHANGED
|
@@ -594,6 +594,7 @@
|
|
|
594
594
|
"app_user_data.clear_dialog.confirming": "Clearing...",
|
|
595
595
|
"user_management.signup_stats.vs_previous": "vs. previous equal period",
|
|
596
596
|
"user_management.signup_stats.prev_count": "prev {{count}}",
|
|
597
|
+
"user_management.signup_stats.prev_template": "prev {count}",
|
|
597
598
|
"user_management.signup_stats.total_users": "total users",
|
|
598
599
|
"user_management.signup_stats.ytd_title": "Signups by month (YTD)",
|
|
599
600
|
"user_management.signup_stats.ytd_aria": "Year-to-date signups by month: {{list}}",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/server_pages/login.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAUrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,+EAA+E;IAC/E,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEvD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,MAAqB,EACrB,cAAc,EACd,aAAqB,GACtB,GAAE,cAAmB,+
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/server_pages/login.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAUrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,+EAA+E;IAC/E,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEvD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,MAAqB,EACrB,cAAc,EACd,aAAqB,GACtB,GAAE,cAAmB,+BA0ErB;AAGD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -45,7 +45,7 @@ export default function LoginPage({ image_src, image_alt, image_background_color
|
|
|
45
45
|
const finalImageSrc = image_src || config.imageSrc;
|
|
46
46
|
const finalImageAlt = image_alt || config.imageAlt;
|
|
47
47
|
const finalImageBackgroundColor = image_background_color || config.imageBackgroundColor;
|
|
48
|
-
const wrapper = (_jsx(LoginClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, redirectRoute: config.redirectRoute, successMessage: config.successMessage, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, forgotPasswordPath: config.forgotPasswordPath, forgotPasswordLabel: config.forgotPasswordLabel, createAccountPath: config.createAccountPath, createAccountLabel: config.createAccountLabel, showCreateAccountLink: config.showCreateAccountLink, oauth: {
|
|
48
|
+
const wrapper = (_jsx(LoginClientWrapper, { image_src: finalImageSrc, image_alt: finalImageAlt, image_background_color: finalImageBackgroundColor, redirectRoute: config.redirectRoute, successMessage: config.successMessage, alreadyLoggedInMessage: config.alreadyLoggedInMessage, showLogoutButton: config.showLogoutButton, showReturnHomeButton: config.showReturnHomeButton, returnHomeButtonLabel: config.returnHomeButtonLabel, returnHomePath: config.returnHomePath, alreadyLoggedInRedirectPath: config.alreadyLoggedInRedirectPath, forgotPasswordPath: config.forgotPasswordPath, forgotPasswordLabel: config.forgotPasswordLabel, createAccountPath: config.createAccountPath, createAccountLabel: config.createAccountLabel, showCreateAccountLink: config.showCreateAccountLink, oauth: {
|
|
49
49
|
enable_google: config.oauth.enable_google,
|
|
50
50
|
enable_email_password: config.oauth.enable_email_password,
|
|
51
51
|
google_button_text: config.oauth.google_button_text,
|
|
@@ -24,5 +24,5 @@ export type LoginClientWrapperProps = Omit<LoginConfig, 'imageSrc' | 'imageAlt'
|
|
|
24
24
|
* Client wrapper for LoginLayout
|
|
25
25
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
26
26
|
*/
|
|
27
|
-
export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink, oauth, layout, labels, defaultValues, }: LoginClientWrapperProps): import("react").JSX.Element;
|
|
27
|
+
export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, alreadyLoggedInRedirectPath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink, oauth, layout, labels, defaultValues, }: LoginClientWrapperProps): import("react").JSX.Element;
|
|
28
28
|
//# sourceMappingURL=login_client_wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/login_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,OAAO,GAAG,uBAAuB,CAAC,GAAG;IAC9I,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,yEAAyE;IACzE,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,wEAAwE;IACxE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD,CAAC;AAGF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,qBAA4B,EAC5B,KAAK,EACL,MAAqB,EACrB,MAAM,EACN,aAAa,GACd,EAAE,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"login_client_wrapper.d.ts","sourceRoot":"","sources":["../../src/server_pages/login_client_wrapper.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,OAAO,GAAG,uBAAuB,CAAC,GAAG;IAC9I,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,yEAAyE;IACzE,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACpC,wEAAwE;IACxE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD,CAAC;AAGF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,qBAA4B,EAC5B,KAAK,EACL,MAAqB,EACrB,MAAM,EACN,aAAa,GACd,EAAE,uBAAuB,+BA8CzB"}
|
|
@@ -12,7 +12,7 @@ import { useAuthT } from "../contexts/hazo_auth_provider.js";
|
|
|
12
12
|
* Client wrapper for LoginLayout
|
|
13
13
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
14
14
|
*/
|
|
15
|
-
export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink = true, oauth, layout = "two_column", labels, defaultValues, }) {
|
|
15
|
+
export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, alreadyLoggedInRedirectPath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink = true, oauth, layout = "two_column", labels, defaultValues, }) {
|
|
16
16
|
const t = useAuthT();
|
|
17
17
|
const [dataClient, setDataClient] = useState(null);
|
|
18
18
|
useEffect(() => {
|
|
@@ -25,5 +25,5 @@ export function LoginClientWrapper({ image_src, image_alt, image_background_colo
|
|
|
25
25
|
if (!dataClient) {
|
|
26
26
|
return (_jsx("div", { className: "cls_login_page_loading flex items-center justify-center min-h-screen", children: _jsx("div", { className: "text-slate-600 animate-pulse", children: t("shared.guard.loading") }) }));
|
|
27
27
|
}
|
|
28
|
-
return (_jsx(LoginLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, redirectRoute: redirectRoute, successMessage: successMessage, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, forgot_password_path: forgotPasswordPath, forgot_password_label: forgotPasswordLabel, create_account_path: createAccountPath, create_account_label: createAccountLabel, show_create_account_link: showCreateAccountLink, oauth: oauth, layout: layout, labels: labels, default_values: defaultValues }));
|
|
28
|
+
return (_jsx(LoginLayout, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, data_client: dataClient, redirectRoute: redirectRoute, successMessage: successMessage, alreadyLoggedInMessage: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, alreadyLoggedInRedirectPath: alreadyLoggedInRedirectPath, forgot_password_path: forgotPasswordPath, forgot_password_label: forgotPasswordLabel, create_account_path: createAccountPath, create_account_label: createAccountLabel, show_create_account_link: showCreateAccountLink, oauth: oauth, layout: layout, labels: labels, default_values: defaultValues }));
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.26.2",
|
|
4
4
|
"description": "Zero-config authentication UI components for Next.js with RBAC, OAuth, scope-based multi-tenancy, and invitations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -278,10 +278,10 @@
|
|
|
278
278
|
"hazo_config": "^2.6.0",
|
|
279
279
|
"hazo_connect": "^4.3.3",
|
|
280
280
|
"hazo_core": "^2.4.1",
|
|
281
|
-
"hazo_i18n": "^0.9.0",
|
|
281
|
+
"hazo_i18n": "^0.9.0 || ^0.15.0",
|
|
282
282
|
"hazo_logs": "^2.3.0",
|
|
283
|
-
"hazo_notify": "^6.
|
|
284
|
-
"hazo_secure": "^1.
|
|
283
|
+
"hazo_notify": "^6.8.0",
|
|
284
|
+
"hazo_secure": "^1.9.0",
|
|
285
285
|
"hazo_theme": "^1.4.0",
|
|
286
286
|
"hazo_ui": "^6.14.0",
|
|
287
287
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
@@ -361,14 +361,14 @@
|
|
|
361
361
|
"eslint": "^9.39.1",
|
|
362
362
|
"eslint-config-next": "^16.0.4",
|
|
363
363
|
"eslint-plugin-storybook": "^10.0.6",
|
|
364
|
-
"hazo_api": "^2.
|
|
364
|
+
"hazo_api": "^2.9.0",
|
|
365
365
|
"hazo_config": "^2.6.0",
|
|
366
|
-
"hazo_connect": "^4.3.
|
|
366
|
+
"hazo_connect": "^4.3.5",
|
|
367
367
|
"hazo_core": "^2.5.0",
|
|
368
|
-
"hazo_logs": "^2.3.
|
|
369
|
-
"hazo_notify": "^6.
|
|
370
|
-
"hazo_theme": "^1.4.
|
|
371
|
-
"hazo_ui": "^6.
|
|
368
|
+
"hazo_logs": "^2.3.1",
|
|
369
|
+
"hazo_notify": "^6.8.1",
|
|
370
|
+
"hazo_theme": "^1.4.2",
|
|
371
|
+
"hazo_ui": "^6.18.0",
|
|
372
372
|
"input-otp": "^1.4.0",
|
|
373
373
|
"jest": "^30.2.0",
|
|
374
374
|
"jest-environment-jsdom": "^30.0.0",
|