hazo_auth 5.3.1 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -17
- package/SETUP_CHECKLIST.md +99 -7
- package/cli-src/cli/generate.ts +10 -1
- package/cli-src/cli/validate.ts +4 -0
- package/cli-src/lib/auth/auth_types.ts +21 -12
- package/cli-src/lib/auth/hazo_get_tenant_auth.server.ts +25 -24
- package/cli-src/lib/auth/index.ts +2 -2
- package/cli-src/lib/auth/with_auth.server.ts +15 -15
- package/cli-src/lib/cookies_config.server.ts +1 -0
- package/cli-src/lib/login_config.server.ts +14 -0
- package/cli-src/lib/otp_config.server.ts +91 -0
- package/cli-src/lib/services/email_service.ts +3 -1
- package/cli-src/lib/services/email_template_manifest.ts +17 -0
- package/cli-src/lib/services/email_templates/otp_signin_code.html +13 -0
- package/cli-src/lib/services/email_templates/otp_signin_code.txt +5 -0
- package/cli-src/lib/services/index.ts +8 -2
- package/cli-src/lib/services/otp_service.ts +295 -0
- package/cli-src/lib/services/session_token_service.ts +4 -1
- package/config/hazo_auth_config.example.ini +38 -0
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +10 -1
- package/dist/cli/validate.d.ts.map +1 -1
- package/dist/cli/validate.js +4 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/components/layouts/login/index.d.ts +7 -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/otp/index.d.ts +10 -0
- package/dist/components/layouts/otp/index.d.ts.map +1 -0
- package/dist/components/layouts/otp/index.js +14 -0
- package/dist/components/layouts/shared/components/sidebar_layout_wrapper.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +8 -3
- package/dist/components/otp/OTPRequestForm.d.ts +11 -0
- package/dist/components/otp/OTPRequestForm.d.ts.map +1 -0
- package/dist/components/otp/OTPRequestForm.js +42 -0
- package/dist/components/otp/OTPVerifyForm.d.ts +16 -0
- package/dist/components/otp/OTPVerifyForm.d.ts.map +1 -0
- package/dist/components/otp/OTPVerifyForm.js +75 -0
- package/dist/components/otp/index.d.ts +5 -0
- package/dist/components/otp/index.d.ts.map +1 -0
- package/dist/components/otp/index.js +2 -0
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +44 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/auth/auth_types.d.ts +13 -12
- package/dist/lib/auth/auth_types.d.ts.map +1 -1
- package/dist/lib/auth/auth_types.js +8 -0
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts +8 -7
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_tenant_auth.server.js +23 -22
- package/dist/lib/auth/index.d.ts +2 -2
- package/dist/lib/auth/index.d.ts.map +1 -1
- package/dist/lib/auth/with_auth.server.d.ts +13 -13
- package/dist/lib/auth/with_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/with_auth.server.js +2 -2
- package/dist/lib/cookies_config.server.d.ts +1 -0
- package/dist/lib/cookies_config.server.d.ts.map +1 -1
- package/dist/lib/cookies_config.server.js +1 -0
- package/dist/lib/login_config.server.d.ts +6 -0
- package/dist/lib/login_config.server.d.ts.map +1 -1
- package/dist/lib/login_config.server.js +7 -0
- package/dist/lib/otp_config.server.d.ts +49 -0
- package/dist/lib/otp_config.server.d.ts.map +1 -0
- package/dist/lib/otp_config.server.js +48 -0
- package/dist/lib/services/email_service.d.ts +1 -1
- package/dist/lib/services/email_service.d.ts.map +1 -1
- package/dist/lib/services/email_service.js +2 -0
- package/dist/lib/services/email_template_manifest.d.ts.map +1 -1
- package/dist/lib/services/email_template_manifest.js +17 -0
- package/dist/lib/services/email_templates/otp_signin_code.html +13 -0
- package/dist/lib/services/email_templates/otp_signin_code.txt +5 -0
- package/dist/lib/services/index.d.ts +2 -0
- package/dist/lib/services/index.d.ts.map +1 -1
- package/dist/lib/services/index.js +1 -0
- package/dist/lib/services/otp_service.d.ts +46 -0
- package/dist/lib/services/otp_service.d.ts.map +1 -0
- package/dist/lib/services/otp_service.js +238 -0
- package/dist/lib/services/session_token_service.d.ts +3 -1
- package/dist/lib/services/session_token_service.d.ts.map +1 -1
- package/dist/lib/services/session_token_service.js +4 -2
- package/dist/page_components/otp.d.ts +4 -0
- package/dist/page_components/otp.d.ts.map +1 -0
- package/dist/page_components/otp.js +5 -0
- package/dist/server/routes/index.d.ts +2 -0
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +3 -0
- package/dist/server/routes/me.d.ts.map +1 -1
- package/dist/server/routes/me.js +43 -1
- package/dist/server/routes/otp/request.d.ts +3 -0
- package/dist/server/routes/otp/request.d.ts.map +1 -0
- package/dist/server/routes/otp/request.js +33 -0
- package/dist/server/routes/otp/verify.d.ts +3 -0
- package/dist/server/routes/otp/verify.d.ts.map +1 -0
- package/dist/server/routes/otp/verify.js +58 -0
- package/dist/server-lib.d.ts +3 -0
- package/dist/server-lib.d.ts.map +1 -1
- package/dist/server-lib.js +2 -0
- package/dist/server_pages/forgot_password.d.ts +1 -1
- package/dist/server_pages/forgot_password.d.ts.map +1 -1
- package/dist/server_pages/forgot_password.js +2 -1
- package/dist/server_pages/login.d.ts +1 -1
- package/dist/server_pages/login.d.ts.map +1 -1
- package/dist/server_pages/login.js +3 -2
- 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/dist/server_pages/my_settings.d.ts +1 -1
- package/dist/server_pages/my_settings.d.ts.map +1 -1
- package/dist/server_pages/my_settings.js +2 -1
- package/dist/server_pages/otp.d.ts +42 -0
- package/dist/server_pages/otp.d.ts.map +1 -0
- package/dist/server_pages/otp.js +38 -0
- package/dist/server_pages/register.d.ts +1 -1
- package/dist/server_pages/register.d.ts.map +1 -1
- package/dist/server_pages/register.js +2 -1
- package/dist/server_pages/reset_password.d.ts +1 -1
- package/dist/server_pages/reset_password.d.ts.map +1 -1
- package/dist/server_pages/reset_password.js +2 -1
- package/dist/server_pages/verify_email.d.ts +1 -1
- package/dist/server_pages/verify_email.d.ts.map +1 -1
- package/dist/server_pages/verify_email.js +2 -1
- package/package.json +20 -3
|
@@ -52,6 +52,6 @@ export type LoginPageProps = {
|
|
|
52
52
|
* @param props - Optional visual customization props
|
|
53
53
|
* @returns Server-rendered login page
|
|
54
54
|
*/
|
|
55
|
-
export default function LoginPage(
|
|
55
|
+
export default function LoginPage(props: LoginPageProps): import("react/jsx-runtime").JSX.Element;
|
|
56
56
|
export { LoginPage };
|
|
57
57
|
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/server_pages/login.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,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;CACrC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/server_pages/login.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,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;CACrC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,2CAoEtD;AAGD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -32,7 +32,8 @@ import { FloatingHomeLink } from "../components/layouts/shared/components/floati
|
|
|
32
32
|
* @param props - Optional visual customization props
|
|
33
33
|
* @returns Server-rendered login page
|
|
34
34
|
*/
|
|
35
|
-
export default function LoginPage(
|
|
35
|
+
export default function LoginPage(props) {
|
|
36
|
+
const { image_src, image_alt, image_background_color, layout = "two_column", } = props !== null && props !== void 0 ? props : {};
|
|
36
37
|
// Load configuration from INI file (with defaults including asset images)
|
|
37
38
|
const config = get_login_config();
|
|
38
39
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
@@ -44,7 +45,7 @@ export default function LoginPage({ image_src, image_alt, image_background_color
|
|
|
44
45
|
enable_email_password: config.oauth.enable_email_password,
|
|
45
46
|
google_button_text: config.oauth.google_button_text,
|
|
46
47
|
oauth_divider_text: config.oauth.oauth_divider_text,
|
|
47
|
-
}, layout: layout }));
|
|
48
|
+
}, otpSigninEnabled: config.otpSigninEnabled, otpSigninLabel: config.otpSigninLabel, otpSigninHref: config.otpSigninHref, layout: layout }));
|
|
48
49
|
// form_only mode: skip AuthPageShell so the consumer's own page chrome
|
|
49
50
|
// (e.g. a split-panel AuthLayout) hosts the form without our standalone
|
|
50
51
|
// wrapper interfering. Two-column mode keeps the existing AuthPageShell
|
|
@@ -16,5 +16,5 @@ export type LoginClientWrapperProps = Omit<LoginConfig, 'imageSrc' | 'imageAlt'
|
|
|
16
16
|
* Client wrapper for LoginLayout
|
|
17
17
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
18
18
|
*/
|
|
19
|
-
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, }: LoginClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink, oauth, otpSigninEnabled, otpSigninLabel, otpSigninHref, layout, }: LoginClientWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
//# 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;AAG3E,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;CACrC,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,GACtB,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;AAG3E,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;CACrC,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,gBAAwB,EACxB,cAA0C,EAC1C,aAAgC,EAChC,MAAqB,GACtB,EAAE,uBAAuB,2CA6CzB"}
|
|
@@ -11,7 +11,7 @@ import { create_sqlite_hazo_connect } from "../lib/hazo_connect_setup.js";
|
|
|
11
11
|
* Client wrapper for LoginLayout
|
|
12
12
|
* Initializes hazo_connect data client on client side and passes config from server
|
|
13
13
|
*/
|
|
14
|
-
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", }) {
|
|
14
|
+
export function LoginClientWrapper({ image_src, image_alt, image_background_color, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgotPasswordPath, forgotPasswordLabel, createAccountPath, createAccountLabel, showCreateAccountLink = true, oauth, otpSigninEnabled = false, otpSigninLabel = "Sign in with email code", otpSigninHref = "/hazo_auth/otp", layout = "two_column", }) {
|
|
15
15
|
const [dataClient, setDataClient] = useState(null);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
// Initialize hazo_connect on client side
|
|
@@ -23,5 +23,5 @@ export function LoginClientWrapper({ image_src, image_alt, image_background_colo
|
|
|
23
23
|
if (!dataClient) {
|
|
24
24
|
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: "Loading..." }) }));
|
|
25
25
|
}
|
|
26
|
-
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 }));
|
|
26
|
+
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, otp_signin_enabled: otpSigninEnabled, otp_signin_label: otpSigninLabel, otp_signin_href: otpSigninHref, layout: layout }));
|
|
27
27
|
}
|
|
@@ -50,6 +50,6 @@ export type MySettingsPageProps = {
|
|
|
50
50
|
* @param props - Optional className for custom styling
|
|
51
51
|
* @returns Server-rendered my settings component
|
|
52
52
|
*/
|
|
53
|
-
export default function MySettingsPage(
|
|
53
|
+
export default function MySettingsPage(props: MySettingsPageProps): import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
export { MySettingsPage };
|
|
55
55
|
//# sourceMappingURL=my_settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/server_pages/my_settings.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"my_settings.d.ts","sourceRoot":"","sources":["../../src/server_pages/my_settings.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAiChE;AAGD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -52,7 +52,8 @@ import { AuthPageShell } from "../components/layouts/shared/components/auth_page
|
|
|
52
52
|
* @param props - Optional className for custom styling
|
|
53
53
|
* @returns Server-rendered my settings component
|
|
54
54
|
*/
|
|
55
|
-
export default function MySettingsPage(
|
|
55
|
+
export default function MySettingsPage(props) {
|
|
56
|
+
const { className } = props !== null && props !== void 0 ? props : {};
|
|
56
57
|
// Load configuration from INI file (with defaults)
|
|
57
58
|
const config = get_my_settings_config();
|
|
58
59
|
// Render layout with all server-initialized configuration, wrapped in AuthPageShell for navbar support
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type OTPPageProps = {
|
|
4
|
+
/**
|
|
5
|
+
* searchParams from Next.js page props — supports both sync and async forms.
|
|
6
|
+
* Reads `redirect` param to set the post-sign-in redirect URL.
|
|
7
|
+
*/
|
|
8
|
+
searchParams?: Promise<{
|
|
9
|
+
redirect?: string;
|
|
10
|
+
}> | {
|
|
11
|
+
redirect?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Page heading passed through to OTPLayout.
|
|
15
|
+
* Defaults to "Sign in with email code".
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Zero-config OTPPage server component
|
|
21
|
+
*
|
|
22
|
+
* Renders an email OTP sign-in flow: the user enters their email, receives a
|
|
23
|
+
* 6-digit code, and is redirected after successful verification.
|
|
24
|
+
*
|
|
25
|
+
* Usage in consuming apps:
|
|
26
|
+
* ```tsx
|
|
27
|
+
* // app/otp/page.tsx
|
|
28
|
+
* import { OTPPage } from "hazo_auth/pages/otp";
|
|
29
|
+
*
|
|
30
|
+
* export default function Page(props) {
|
|
31
|
+
* return <OTPPage {...props} />;
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Pass `?redirect=/dashboard` in the URL to control the post-sign-in destination.
|
|
36
|
+
*
|
|
37
|
+
* @param props - Optional searchParams and title
|
|
38
|
+
* @returns Server-rendered OTP sign-in page
|
|
39
|
+
*/
|
|
40
|
+
export default function OTPPage({ searchParams, title, }?: OTPPageProps): Promise<React.ReactElement>;
|
|
41
|
+
export { OTPPage };
|
|
42
|
+
//# sourceMappingURL=otp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../src/server_pages/otp.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEtE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAA8B,OAAO,CAAC,EACpC,YAAY,EACZ,KAAK,GACN,GAAE,YAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAYjD;AAGD,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// file_description: Zero-config OTPPage server component - drop in and use with no configuration required
|
|
3
|
+
// section: server-only-guard
|
|
4
|
+
import "server-only";
|
|
5
|
+
import { OTPLayout } from "../components/layouts/otp.js";
|
|
6
|
+
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
7
|
+
// section: component
|
|
8
|
+
/**
|
|
9
|
+
* Zero-config OTPPage server component
|
|
10
|
+
*
|
|
11
|
+
* Renders an email OTP sign-in flow: the user enters their email, receives a
|
|
12
|
+
* 6-digit code, and is redirected after successful verification.
|
|
13
|
+
*
|
|
14
|
+
* Usage in consuming apps:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // app/otp/page.tsx
|
|
17
|
+
* import { OTPPage } from "hazo_auth/pages/otp";
|
|
18
|
+
*
|
|
19
|
+
* export default function Page(props) {
|
|
20
|
+
* return <OTPPage {...props} />;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Pass `?redirect=/dashboard` in the URL to control the post-sign-in destination.
|
|
25
|
+
*
|
|
26
|
+
* @param props - Optional searchParams and title
|
|
27
|
+
* @returns Server-rendered OTP sign-in page
|
|
28
|
+
*/
|
|
29
|
+
export default async function OTPPage({ searchParams, title, } = {}) {
|
|
30
|
+
var _a;
|
|
31
|
+
const params = searchParams instanceof Promise
|
|
32
|
+
? await searchParams
|
|
33
|
+
: (searchParams !== null && searchParams !== void 0 ? searchParams : {});
|
|
34
|
+
const redirect_url = (_a = params.redirect) !== null && _a !== void 0 ? _a : "/";
|
|
35
|
+
return (_jsx(AuthPageShell, { children: _jsx(OTPLayout, { redirect_url: redirect_url, title: title }) }));
|
|
36
|
+
}
|
|
37
|
+
// Named export for direct imports
|
|
38
|
+
export { OTPPage };
|
|
@@ -48,6 +48,6 @@ export type RegisterPageProps = {
|
|
|
48
48
|
* @param props - Optional visual customization props
|
|
49
49
|
* @returns Server-rendered register page
|
|
50
50
|
*/
|
|
51
|
-
export default function RegisterPage(
|
|
51
|
+
export default function RegisterPage(props: RegisterPageProps): import("react/jsx-runtime").JSX.Element;
|
|
52
52
|
export { RegisterPage };
|
|
53
53
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/server_pages/register.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;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;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/server_pages/register.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;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;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAuD5D;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -34,7 +34,8 @@ import { FloatingHomeLink } from "../components/layouts/shared/components/floati
|
|
|
34
34
|
* @param props - Optional visual customization props
|
|
35
35
|
* @returns Server-rendered register page
|
|
36
36
|
*/
|
|
37
|
-
export default function RegisterPage(
|
|
37
|
+
export default function RegisterPage(props) {
|
|
38
|
+
const { image_src, image_alt, image_background_color, layout = "two_column", } = props !== null && props !== void 0 ? props : {};
|
|
38
39
|
// Load configuration from INI file (with defaults including asset images)
|
|
39
40
|
const config = get_register_config();
|
|
40
41
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
@@ -41,6 +41,6 @@ export type ResetPasswordPageProps = {
|
|
|
41
41
|
* @param props - Optional visual customization props
|
|
42
42
|
* @returns Server-rendered reset password page
|
|
43
43
|
*/
|
|
44
|
-
export default function ResetPasswordPage(
|
|
44
|
+
export default function ResetPasswordPage(props: ResetPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
export { ResetPasswordPage };
|
|
46
46
|
//# sourceMappingURL=reset_password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/server_pages/reset_password.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;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;CACjC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"reset_password.d.ts","sourceRoot":"","sources":["../../src/server_pages/reset_password.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;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;CACjC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAkCtE;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -31,7 +31,8 @@ import { AuthPageShell } from "../components/layouts/shared/components/auth_page
|
|
|
31
31
|
* @param props - Optional visual customization props
|
|
32
32
|
* @returns Server-rendered reset password page
|
|
33
33
|
*/
|
|
34
|
-
export default function ResetPasswordPage(
|
|
34
|
+
export default function ResetPasswordPage(props) {
|
|
35
|
+
const { image_src, image_alt, image_background_color, } = props !== null && props !== void 0 ? props : {};
|
|
35
36
|
// Load configuration from INI file (with defaults including asset images)
|
|
36
37
|
const config = get_reset_password_config();
|
|
37
38
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
|
@@ -50,6 +50,6 @@ export type VerifyEmailPageProps = {
|
|
|
50
50
|
* @param props - Optional visual and behavior customization props
|
|
51
51
|
* @returns Server-rendered email verification page
|
|
52
52
|
*/
|
|
53
|
-
export default function VerifyEmailPage(
|
|
53
|
+
export default function VerifyEmailPage(props: VerifyEmailPageProps): import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
export { VerifyEmailPage };
|
|
55
55
|
//# sourceMappingURL=verify_email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/server_pages/verify_email.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;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;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"verify_email.d.ts","sourceRoot":"","sources":["../../src/server_pages/verify_email.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;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;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAiClE;AAGD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -31,7 +31,8 @@ import { DEFAULT_EMAIL_VERIFICATION } from "../lib/config/default_config.js";
|
|
|
31
31
|
* @param props - Optional visual and behavior customization props
|
|
32
32
|
* @returns Server-rendered email verification page
|
|
33
33
|
*/
|
|
34
|
-
export default function VerifyEmailPage(
|
|
34
|
+
export default function VerifyEmailPage(props) {
|
|
35
|
+
const { image_src, image_alt, image_background_color, redirect_delay = DEFAULT_EMAIL_VERIFICATION.redirectDelay, login_path = DEFAULT_EMAIL_VERIFICATION.loginPath, } = props !== null && props !== void 0 ? props : {};
|
|
35
36
|
// Load configuration from INI file (with defaults including asset images)
|
|
36
37
|
const config = get_email_verification_config();
|
|
37
38
|
// Use props if provided, otherwise fall back to config (which includes default asset image)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.1",
|
|
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",
|
|
@@ -81,6 +81,10 @@
|
|
|
81
81
|
"types": "./dist/components/layouts/create_firm/index.d.ts",
|
|
82
82
|
"import": "./dist/components/layouts/create_firm/index.js"
|
|
83
83
|
},
|
|
84
|
+
"./components/layouts/otp": {
|
|
85
|
+
"types": "./dist/components/layouts/otp/index.d.ts",
|
|
86
|
+
"import": "./dist/components/layouts/otp/index.js"
|
|
87
|
+
},
|
|
84
88
|
"./components/layouts/shared": {
|
|
85
89
|
"types": "./dist/components/layouts/shared/index.d.ts",
|
|
86
90
|
"import": "./dist/components/layouts/shared/index.js"
|
|
@@ -113,6 +117,10 @@
|
|
|
113
117
|
"types": "./dist/server_pages/login.d.ts",
|
|
114
118
|
"import": "./dist/server_pages/login.js"
|
|
115
119
|
},
|
|
120
|
+
"./pages/otp": {
|
|
121
|
+
"types": "./dist/server_pages/otp.d.ts",
|
|
122
|
+
"import": "./dist/server_pages/otp.js"
|
|
123
|
+
},
|
|
116
124
|
"./pages/register": {
|
|
117
125
|
"types": "./dist/server_pages/register.d.ts",
|
|
118
126
|
"import": "./dist/server_pages/register.js"
|
|
@@ -141,6 +149,10 @@
|
|
|
141
149
|
"types": "./dist/page_components/login.d.ts",
|
|
142
150
|
"import": "./dist/page_components/login.js"
|
|
143
151
|
},
|
|
152
|
+
"./page_components/otp": {
|
|
153
|
+
"types": "./dist/page_components/otp.d.ts",
|
|
154
|
+
"import": "./dist/page_components/otp.js"
|
|
155
|
+
},
|
|
144
156
|
"./page_components/register": {
|
|
145
157
|
"types": "./dist/page_components/register.d.ts",
|
|
146
158
|
"import": "./dist/page_components/register.js"
|
|
@@ -250,10 +262,11 @@
|
|
|
250
262
|
"@radix-ui/react-tabs": "^1.1.0",
|
|
251
263
|
"@radix-ui/react-tooltip": "^1.2.0",
|
|
252
264
|
"hazo_config": "^2.1.0",
|
|
253
|
-
"hazo_connect": "^2.
|
|
265
|
+
"hazo_connect": "^2.6.0",
|
|
254
266
|
"hazo_logs": "^1.0.13",
|
|
255
267
|
"hazo_notify": "^3.0.0",
|
|
256
268
|
"hazo_ui": "^2.7.0",
|
|
269
|
+
"input-otp": "^1.4.0",
|
|
257
270
|
"lucide-react": "^0.553.0",
|
|
258
271
|
"next": ">=14.0.0",
|
|
259
272
|
"next-auth": "^4.24.0",
|
|
@@ -278,6 +291,9 @@
|
|
|
278
291
|
"hazo_ui": {
|
|
279
292
|
"optional": true
|
|
280
293
|
},
|
|
294
|
+
"input-otp": {
|
|
295
|
+
"optional": true
|
|
296
|
+
},
|
|
281
297
|
"next-themes": {
|
|
282
298
|
"optional": true
|
|
283
299
|
},
|
|
@@ -374,12 +390,13 @@
|
|
|
374
390
|
"eslint-plugin-storybook": "^10.0.6",
|
|
375
391
|
"@tailwindcss/postcss": "^4.2.4",
|
|
376
392
|
"hazo_config": "^2.1.0",
|
|
377
|
-
"hazo_connect": "^2.
|
|
393
|
+
"hazo_connect": "^2.6.0",
|
|
378
394
|
"hazo_logs": "^1.0.13",
|
|
379
395
|
"hazo_notify": "^3.0.0",
|
|
380
396
|
"hazo_ui": "^2.7.0",
|
|
381
397
|
"jest": "^30.2.0",
|
|
382
398
|
"jest-environment-jsdom": "^30.0.0",
|
|
399
|
+
"input-otp": "^1.4.0",
|
|
383
400
|
"lucide-react": "^0.553.0",
|
|
384
401
|
"next": "^16.0.7",
|
|
385
402
|
"next-auth": "^4.24.13",
|