mailsentry-auth 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +54 -16
- package/dist/index.d.ts +54 -16
- package/dist/index.js +78 -36
- package/dist/index.mjs +80 -38
- package/dist/middleware.mjs +7 -0
- package/dist/utils/cookie-utils.js +7 -0
- package/dist/utils/cookie-utils.mjs +7 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -354,6 +354,10 @@ declare class CrossTabBehaviorHandler {
|
|
|
354
354
|
* Get current page type using object lookup pattern
|
|
355
355
|
*/
|
|
356
356
|
static getCurrentPageType(): PageType;
|
|
357
|
+
/**
|
|
358
|
+
* Check if current route is excluded from automatic reload
|
|
359
|
+
*/
|
|
360
|
+
private static isReloadExcluded;
|
|
357
361
|
/**
|
|
358
362
|
* Get the action configuration for current route and event
|
|
359
363
|
*/
|
|
@@ -381,6 +385,14 @@ declare class CrossTabBehaviorHandler {
|
|
|
381
385
|
readonly action: NavigationAction.NONE;
|
|
382
386
|
} | {
|
|
383
387
|
readonly action: NavigationAction.NONE;
|
|
388
|
+
} | {
|
|
389
|
+
readonly action: NavigationAction.NONE;
|
|
390
|
+
} | {
|
|
391
|
+
readonly action: NavigationAction.NONE;
|
|
392
|
+
} | {
|
|
393
|
+
readonly action: NavigationAction.NONE;
|
|
394
|
+
} | {
|
|
395
|
+
readonly action: NavigationAction.NONE;
|
|
384
396
|
};
|
|
385
397
|
}
|
|
386
398
|
|
|
@@ -1030,18 +1042,11 @@ interface ForgotPasswordStepProps extends BaseStepProps {
|
|
|
1030
1042
|
onSubmit: (email: string) => void | Promise<void>;
|
|
1031
1043
|
}
|
|
1032
1044
|
|
|
1033
|
-
|
|
1034
|
-
DEFAULT = "default",
|
|
1035
|
-
WITH_IMAGE = "with_image"
|
|
1045
|
+
interface AuthFlowContainerProps {
|
|
1036
1046
|
}
|
|
1037
|
-
|
|
1038
|
-
variant?: AuthFlowVariant;
|
|
1039
|
-
backgroundImage?: string;
|
|
1040
|
-
};
|
|
1041
|
-
type AuthFlowContainerProps = AuthFlowProps;
|
|
1042
|
-
type AuthFlowModalProps = AuthFlowProps & {
|
|
1047
|
+
interface AuthFlowModalProps {
|
|
1043
1048
|
children: ReactNode;
|
|
1044
|
-
}
|
|
1049
|
+
}
|
|
1045
1050
|
|
|
1046
1051
|
declare enum ProfileUIState {
|
|
1047
1052
|
LOADING = "LOADING",
|
|
@@ -1158,6 +1163,14 @@ declare enum RoleType {
|
|
|
1158
1163
|
USER = "USER",
|
|
1159
1164
|
ADMIN = "ADMIN"
|
|
1160
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Enum for user authentication types
|
|
1168
|
+
*/
|
|
1169
|
+
declare enum UserType {
|
|
1170
|
+
AUTHENTICATED = "AUTHENTICATED",
|
|
1171
|
+
PUBLIC = "PUBLIC",
|
|
1172
|
+
GUEST = "GUEST"
|
|
1173
|
+
}
|
|
1161
1174
|
type AuthState = {
|
|
1162
1175
|
isAuthenticated: boolean;
|
|
1163
1176
|
isLoading: boolean;
|
|
@@ -1274,7 +1287,8 @@ type AuthEvent = {
|
|
|
1274
1287
|
declare enum PageType {
|
|
1275
1288
|
LOGIN = "/login",
|
|
1276
1289
|
DASHBOARD = "dashboard",
|
|
1277
|
-
HOME = "/"
|
|
1290
|
+
HOME = "/",
|
|
1291
|
+
EXCLUDED = "excluded"
|
|
1278
1292
|
}
|
|
1279
1293
|
declare enum NavigationAction {
|
|
1280
1294
|
NONE = "none",
|
|
@@ -1329,6 +1343,20 @@ declare const CrossTabBehaviorConfig: {
|
|
|
1329
1343
|
readonly action: NavigationAction.NONE;
|
|
1330
1344
|
};
|
|
1331
1345
|
};
|
|
1346
|
+
readonly excluded: {
|
|
1347
|
+
readonly "auth.logged_in": {
|
|
1348
|
+
readonly action: NavigationAction.NONE;
|
|
1349
|
+
};
|
|
1350
|
+
readonly "auth.logged_out": {
|
|
1351
|
+
readonly action: NavigationAction.NONE;
|
|
1352
|
+
};
|
|
1353
|
+
readonly "auth.email_verified": {
|
|
1354
|
+
readonly action: NavigationAction.NONE;
|
|
1355
|
+
};
|
|
1356
|
+
readonly "auth.signin_required_modal": {
|
|
1357
|
+
readonly action: NavigationAction.NONE;
|
|
1358
|
+
};
|
|
1359
|
+
};
|
|
1332
1360
|
};
|
|
1333
1361
|
|
|
1334
1362
|
/**
|
|
@@ -1426,6 +1454,11 @@ declare class MiddlewareConfig {
|
|
|
1426
1454
|
* Format: "host:path" or "path"
|
|
1427
1455
|
*/
|
|
1428
1456
|
static getGuestOnlyRules(): ProtectionRule[];
|
|
1457
|
+
/**
|
|
1458
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
1459
|
+
* Format: "host:path" or "path"
|
|
1460
|
+
*/
|
|
1461
|
+
static getReloadExclusionRules(): ProtectionRule[];
|
|
1429
1462
|
/**
|
|
1430
1463
|
* Generic parser for environment variables containing rule lists
|
|
1431
1464
|
*/
|
|
@@ -1569,9 +1602,9 @@ declare const useStepRenderer: () => {
|
|
|
1569
1602
|
getStepComponent: (step: AuthFlowStep) => StepComponent | null;
|
|
1570
1603
|
};
|
|
1571
1604
|
|
|
1572
|
-
declare function AuthFlowContainer({
|
|
1605
|
+
declare function AuthFlowContainer({}: AuthFlowContainerProps): React__default.JSX.Element;
|
|
1573
1606
|
|
|
1574
|
-
declare function AuthFlowModal({ children
|
|
1607
|
+
declare function AuthFlowModal({ children }: AuthFlowModalProps): React__default.JSX.Element;
|
|
1575
1608
|
|
|
1576
1609
|
/**
|
|
1577
1610
|
* Auth Initializer Component
|
|
@@ -1684,10 +1717,15 @@ declare const useUserActions: () => {
|
|
|
1684
1717
|
clearPublicUser: () => void;
|
|
1685
1718
|
};
|
|
1686
1719
|
/**
|
|
1687
|
-
* Hook for checking authentication status
|
|
1720
|
+
* Hook for checking authentication status and user type
|
|
1688
1721
|
*/
|
|
1689
1722
|
declare const useAuth: () => {
|
|
1690
|
-
|
|
1723
|
+
authStatus: {
|
|
1724
|
+
type: UserType;
|
|
1725
|
+
isAuthenticated: boolean;
|
|
1726
|
+
isPublic: boolean;
|
|
1727
|
+
isGuest: boolean;
|
|
1728
|
+
};
|
|
1691
1729
|
isLoading: boolean;
|
|
1692
1730
|
error: string | null;
|
|
1693
1731
|
user: UserProfile | null;
|
|
@@ -1778,4 +1816,4 @@ declare const useAuthFlowModal: () => {
|
|
|
1778
1816
|
openModal: () => void;
|
|
1779
1817
|
};
|
|
1780
1818
|
|
|
1781
|
-
export { AUTH_ENDPOINTS, AlertDisplay, type AlertDisplayProps, type AnyStepProps, ApiErrorHandler, type ApiErrorResponse, type ApiKeyConfig, type AuthActionCallbacks, type AuthActionOptions, type AuthActionResult, type AuthActionResultFailure, type AuthActionResultSuccess, type AuthActionState, type AuthEvent, AuthEventType, AuthFlowContainer, type AuthFlowContainerProps, AuthFlowModal, type AuthFlowModalProps,
|
|
1819
|
+
export { AUTH_ENDPOINTS, AlertDisplay, type AlertDisplayProps, type AnyStepProps, ApiErrorHandler, type ApiErrorResponse, type ApiKeyConfig, type AuthActionCallbacks, type AuthActionOptions, type AuthActionResult, type AuthActionResultFailure, type AuthActionResultSuccess, type AuthActionState, type AuthEvent, AuthEventType, AuthFlowContainer, type AuthFlowContainerProps, AuthFlowModal, type AuthFlowModalProps, AuthFlowStep, AuthInitializer, AuthOrchestrator, AuthOrchestratorFactory, AuthResultFactory, AuthService, type AuthState, AuthenticatedState, type AuthenticatedStateProps, AuthenticationStatusContext, type BaseComponentProps, BaseErrorHandler, BaseEventBus, BaseForm, type BaseFormField, type BaseFormProps, type BaseResponse, BaseService, type BaseStepProps, BroadcastChannelEventBus, Channel, CookieUtils, CrossTabBehaviorConfig, CrossTabBehaviorHandler, CrossTabDemo, DevelopmentLogger, EMAIL_SUBMISSION_NAVIGATION, type EmailCheckResult, type EmailExistResponse, type EmailProviderConfig, EmailProviderUtils, EmailStep, type EmailStepProps, EndpointBuilder, type EventBus, ExistingUserLoginStrategy, type ForgotPasswordStepProps, FormFields, type FormFieldsProps, FormHeader, type FormHeaderProps, HttpClient, type HttpClientConfig, type HttpError, HttpMethod, type HttpRequestOptions, type HttpResponse, type IAuthOrchestrator, type IAuthService, type IAuthStatusState, type ICleanupStrategy, type IErrorHandler, type ILogger, type ILoginFlowStrategy, type ITokenManager, LocalStorageUtils, LoggerFactory, type LoginData, LoginFlowStrategyFactory, type LoginRequest, type LoginResponse, LoginStrategyResolver, LoginVerificationStrategy, MiddlewareConfig, type MiddlewareContext, type MiddlewareHandler, NavigationAction, NetworkErrorHandler, NextAction, PASSWORD_SUBMISSION_NAVIGATION, PageType, PageTypePatterns, PasswordInputWithStrength, type PasswordInputWithStrengthProps, PasswordStep, type PasswordStepProps, type PasswordStrengthRule, ProductionLogger, ProfileStateRenderer, ProfileUIState, type PropsFactory, type ProtectionRule, type PublicUserProfile, type PublicUserProfileResponse, RoleType, SignupFlowStrategy, type Step, type StepComponent, type StepComponentRetriever, type StepConfig, type StepPropsFactoryRegistry, type StepRegistry, type StepRegistryBaseProps, type StepRegistryConfigs, type StepRegistryHandlers, type StepRegistryParams, type StepRegistryState, type StepperActions, type StepperState$1 as StepperState, StrategyResolutionMode, type StrengthResult, type Subscription, TokenManager, UnauthenticatedState, UrlCleanupHandler, UrlUtils, type UseAuthActionHandler, type UseAuthEventBusProps, type UseFormSubmissionProps, type UseStepRegistryParams, type UseStepperReturn, type UserProfile, type UserProfileResponse, type UserSession, type UserState, UserStorageManager, type UserStoreState, UserType, VERIFICATION_SUBMISSION_NAVIGATION, VerificationStep, type VerificationStepProps, type VerifyEmailRequest, type VerifyEmailResponse, config, createAuthSteps, createPropsFactoryRegistry, createStepRegistry, getAuthPageStepMessage, getEmailField, getForgotPasswordField, getPasswordField, getStepForEmailSubmission, getStepForPasswordSubmission, getStepForVerificationSubmission, getStepProgressMessage, getTermsCheckboxField, getVerificationField, isPublicUser, isPublicUserEmail, middlewareMatcher, useAuth, useAuthActionHandler, useAuthEventBus, useAuthFlowModal, useAuthInitializer, useIsAuthenticated, useLogout, usePublicUserSession, useRefreshUser, useSharedEventBus, useSignInRequiredParams, useStepRegistry, useStepRenderer, useStepper, useUser, useUserActions, useUserData, useUserError, useUserLoading, useUserProfile, useUserSelectors, useUserStore, userSelectors };
|
package/dist/index.d.ts
CHANGED
|
@@ -354,6 +354,10 @@ declare class CrossTabBehaviorHandler {
|
|
|
354
354
|
* Get current page type using object lookup pattern
|
|
355
355
|
*/
|
|
356
356
|
static getCurrentPageType(): PageType;
|
|
357
|
+
/**
|
|
358
|
+
* Check if current route is excluded from automatic reload
|
|
359
|
+
*/
|
|
360
|
+
private static isReloadExcluded;
|
|
357
361
|
/**
|
|
358
362
|
* Get the action configuration for current route and event
|
|
359
363
|
*/
|
|
@@ -381,6 +385,14 @@ declare class CrossTabBehaviorHandler {
|
|
|
381
385
|
readonly action: NavigationAction.NONE;
|
|
382
386
|
} | {
|
|
383
387
|
readonly action: NavigationAction.NONE;
|
|
388
|
+
} | {
|
|
389
|
+
readonly action: NavigationAction.NONE;
|
|
390
|
+
} | {
|
|
391
|
+
readonly action: NavigationAction.NONE;
|
|
392
|
+
} | {
|
|
393
|
+
readonly action: NavigationAction.NONE;
|
|
394
|
+
} | {
|
|
395
|
+
readonly action: NavigationAction.NONE;
|
|
384
396
|
};
|
|
385
397
|
}
|
|
386
398
|
|
|
@@ -1030,18 +1042,11 @@ interface ForgotPasswordStepProps extends BaseStepProps {
|
|
|
1030
1042
|
onSubmit: (email: string) => void | Promise<void>;
|
|
1031
1043
|
}
|
|
1032
1044
|
|
|
1033
|
-
|
|
1034
|
-
DEFAULT = "default",
|
|
1035
|
-
WITH_IMAGE = "with_image"
|
|
1045
|
+
interface AuthFlowContainerProps {
|
|
1036
1046
|
}
|
|
1037
|
-
|
|
1038
|
-
variant?: AuthFlowVariant;
|
|
1039
|
-
backgroundImage?: string;
|
|
1040
|
-
};
|
|
1041
|
-
type AuthFlowContainerProps = AuthFlowProps;
|
|
1042
|
-
type AuthFlowModalProps = AuthFlowProps & {
|
|
1047
|
+
interface AuthFlowModalProps {
|
|
1043
1048
|
children: ReactNode;
|
|
1044
|
-
}
|
|
1049
|
+
}
|
|
1045
1050
|
|
|
1046
1051
|
declare enum ProfileUIState {
|
|
1047
1052
|
LOADING = "LOADING",
|
|
@@ -1158,6 +1163,14 @@ declare enum RoleType {
|
|
|
1158
1163
|
USER = "USER",
|
|
1159
1164
|
ADMIN = "ADMIN"
|
|
1160
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Enum for user authentication types
|
|
1168
|
+
*/
|
|
1169
|
+
declare enum UserType {
|
|
1170
|
+
AUTHENTICATED = "AUTHENTICATED",
|
|
1171
|
+
PUBLIC = "PUBLIC",
|
|
1172
|
+
GUEST = "GUEST"
|
|
1173
|
+
}
|
|
1161
1174
|
type AuthState = {
|
|
1162
1175
|
isAuthenticated: boolean;
|
|
1163
1176
|
isLoading: boolean;
|
|
@@ -1274,7 +1287,8 @@ type AuthEvent = {
|
|
|
1274
1287
|
declare enum PageType {
|
|
1275
1288
|
LOGIN = "/login",
|
|
1276
1289
|
DASHBOARD = "dashboard",
|
|
1277
|
-
HOME = "/"
|
|
1290
|
+
HOME = "/",
|
|
1291
|
+
EXCLUDED = "excluded"
|
|
1278
1292
|
}
|
|
1279
1293
|
declare enum NavigationAction {
|
|
1280
1294
|
NONE = "none",
|
|
@@ -1329,6 +1343,20 @@ declare const CrossTabBehaviorConfig: {
|
|
|
1329
1343
|
readonly action: NavigationAction.NONE;
|
|
1330
1344
|
};
|
|
1331
1345
|
};
|
|
1346
|
+
readonly excluded: {
|
|
1347
|
+
readonly "auth.logged_in": {
|
|
1348
|
+
readonly action: NavigationAction.NONE;
|
|
1349
|
+
};
|
|
1350
|
+
readonly "auth.logged_out": {
|
|
1351
|
+
readonly action: NavigationAction.NONE;
|
|
1352
|
+
};
|
|
1353
|
+
readonly "auth.email_verified": {
|
|
1354
|
+
readonly action: NavigationAction.NONE;
|
|
1355
|
+
};
|
|
1356
|
+
readonly "auth.signin_required_modal": {
|
|
1357
|
+
readonly action: NavigationAction.NONE;
|
|
1358
|
+
};
|
|
1359
|
+
};
|
|
1332
1360
|
};
|
|
1333
1361
|
|
|
1334
1362
|
/**
|
|
@@ -1426,6 +1454,11 @@ declare class MiddlewareConfig {
|
|
|
1426
1454
|
* Format: "host:path" or "path"
|
|
1427
1455
|
*/
|
|
1428
1456
|
static getGuestOnlyRules(): ProtectionRule[];
|
|
1457
|
+
/**
|
|
1458
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
1459
|
+
* Format: "host:path" or "path"
|
|
1460
|
+
*/
|
|
1461
|
+
static getReloadExclusionRules(): ProtectionRule[];
|
|
1429
1462
|
/**
|
|
1430
1463
|
* Generic parser for environment variables containing rule lists
|
|
1431
1464
|
*/
|
|
@@ -1569,9 +1602,9 @@ declare const useStepRenderer: () => {
|
|
|
1569
1602
|
getStepComponent: (step: AuthFlowStep) => StepComponent | null;
|
|
1570
1603
|
};
|
|
1571
1604
|
|
|
1572
|
-
declare function AuthFlowContainer({
|
|
1605
|
+
declare function AuthFlowContainer({}: AuthFlowContainerProps): React__default.JSX.Element;
|
|
1573
1606
|
|
|
1574
|
-
declare function AuthFlowModal({ children
|
|
1607
|
+
declare function AuthFlowModal({ children }: AuthFlowModalProps): React__default.JSX.Element;
|
|
1575
1608
|
|
|
1576
1609
|
/**
|
|
1577
1610
|
* Auth Initializer Component
|
|
@@ -1684,10 +1717,15 @@ declare const useUserActions: () => {
|
|
|
1684
1717
|
clearPublicUser: () => void;
|
|
1685
1718
|
};
|
|
1686
1719
|
/**
|
|
1687
|
-
* Hook for checking authentication status
|
|
1720
|
+
* Hook for checking authentication status and user type
|
|
1688
1721
|
*/
|
|
1689
1722
|
declare const useAuth: () => {
|
|
1690
|
-
|
|
1723
|
+
authStatus: {
|
|
1724
|
+
type: UserType;
|
|
1725
|
+
isAuthenticated: boolean;
|
|
1726
|
+
isPublic: boolean;
|
|
1727
|
+
isGuest: boolean;
|
|
1728
|
+
};
|
|
1691
1729
|
isLoading: boolean;
|
|
1692
1730
|
error: string | null;
|
|
1693
1731
|
user: UserProfile | null;
|
|
@@ -1778,4 +1816,4 @@ declare const useAuthFlowModal: () => {
|
|
|
1778
1816
|
openModal: () => void;
|
|
1779
1817
|
};
|
|
1780
1818
|
|
|
1781
|
-
export { AUTH_ENDPOINTS, AlertDisplay, type AlertDisplayProps, type AnyStepProps, ApiErrorHandler, type ApiErrorResponse, type ApiKeyConfig, type AuthActionCallbacks, type AuthActionOptions, type AuthActionResult, type AuthActionResultFailure, type AuthActionResultSuccess, type AuthActionState, type AuthEvent, AuthEventType, AuthFlowContainer, type AuthFlowContainerProps, AuthFlowModal, type AuthFlowModalProps,
|
|
1819
|
+
export { AUTH_ENDPOINTS, AlertDisplay, type AlertDisplayProps, type AnyStepProps, ApiErrorHandler, type ApiErrorResponse, type ApiKeyConfig, type AuthActionCallbacks, type AuthActionOptions, type AuthActionResult, type AuthActionResultFailure, type AuthActionResultSuccess, type AuthActionState, type AuthEvent, AuthEventType, AuthFlowContainer, type AuthFlowContainerProps, AuthFlowModal, type AuthFlowModalProps, AuthFlowStep, AuthInitializer, AuthOrchestrator, AuthOrchestratorFactory, AuthResultFactory, AuthService, type AuthState, AuthenticatedState, type AuthenticatedStateProps, AuthenticationStatusContext, type BaseComponentProps, BaseErrorHandler, BaseEventBus, BaseForm, type BaseFormField, type BaseFormProps, type BaseResponse, BaseService, type BaseStepProps, BroadcastChannelEventBus, Channel, CookieUtils, CrossTabBehaviorConfig, CrossTabBehaviorHandler, CrossTabDemo, DevelopmentLogger, EMAIL_SUBMISSION_NAVIGATION, type EmailCheckResult, type EmailExistResponse, type EmailProviderConfig, EmailProviderUtils, EmailStep, type EmailStepProps, EndpointBuilder, type EventBus, ExistingUserLoginStrategy, type ForgotPasswordStepProps, FormFields, type FormFieldsProps, FormHeader, type FormHeaderProps, HttpClient, type HttpClientConfig, type HttpError, HttpMethod, type HttpRequestOptions, type HttpResponse, type IAuthOrchestrator, type IAuthService, type IAuthStatusState, type ICleanupStrategy, type IErrorHandler, type ILogger, type ILoginFlowStrategy, type ITokenManager, LocalStorageUtils, LoggerFactory, type LoginData, LoginFlowStrategyFactory, type LoginRequest, type LoginResponse, LoginStrategyResolver, LoginVerificationStrategy, MiddlewareConfig, type MiddlewareContext, type MiddlewareHandler, NavigationAction, NetworkErrorHandler, NextAction, PASSWORD_SUBMISSION_NAVIGATION, PageType, PageTypePatterns, PasswordInputWithStrength, type PasswordInputWithStrengthProps, PasswordStep, type PasswordStepProps, type PasswordStrengthRule, ProductionLogger, ProfileStateRenderer, ProfileUIState, type PropsFactory, type ProtectionRule, type PublicUserProfile, type PublicUserProfileResponse, RoleType, SignupFlowStrategy, type Step, type StepComponent, type StepComponentRetriever, type StepConfig, type StepPropsFactoryRegistry, type StepRegistry, type StepRegistryBaseProps, type StepRegistryConfigs, type StepRegistryHandlers, type StepRegistryParams, type StepRegistryState, type StepperActions, type StepperState$1 as StepperState, StrategyResolutionMode, type StrengthResult, type Subscription, TokenManager, UnauthenticatedState, UrlCleanupHandler, UrlUtils, type UseAuthActionHandler, type UseAuthEventBusProps, type UseFormSubmissionProps, type UseStepRegistryParams, type UseStepperReturn, type UserProfile, type UserProfileResponse, type UserSession, type UserState, UserStorageManager, type UserStoreState, UserType, VERIFICATION_SUBMISSION_NAVIGATION, VerificationStep, type VerificationStepProps, type VerifyEmailRequest, type VerifyEmailResponse, config, createAuthSteps, createPropsFactoryRegistry, createStepRegistry, getAuthPageStepMessage, getEmailField, getForgotPasswordField, getPasswordField, getStepForEmailSubmission, getStepForPasswordSubmission, getStepForVerificationSubmission, getStepProgressMessage, getTermsCheckboxField, getVerificationField, isPublicUser, isPublicUserEmail, middlewareMatcher, useAuth, useAuthActionHandler, useAuthEventBus, useAuthFlowModal, useAuthInitializer, useIsAuthenticated, useLogout, usePublicUserSession, useRefreshUser, useSharedEventBus, useSignInRequiredParams, useStepRegistry, useStepRenderer, useStepper, useUser, useUserActions, useUserData, useUserError, useUserLoading, useUserProfile, useUserSelectors, useUserStore, userSelectors };
|
package/dist/index.js
CHANGED
|
@@ -41,13 +41,6 @@ var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
|
41
41
|
return HttpMethod2;
|
|
42
42
|
})(HttpMethod || {});
|
|
43
43
|
|
|
44
|
-
// src/types/components/auth-flow.ts
|
|
45
|
-
var AuthFlowVariant = /* @__PURE__ */ ((AuthFlowVariant2) => {
|
|
46
|
-
AuthFlowVariant2["DEFAULT"] = "default";
|
|
47
|
-
AuthFlowVariant2["WITH_IMAGE"] = "with_image";
|
|
48
|
-
return AuthFlowVariant2;
|
|
49
|
-
})(AuthFlowVariant || {});
|
|
50
|
-
|
|
51
44
|
// src/types/components/profile.ts
|
|
52
45
|
var ProfileUIState = /* @__PURE__ */ ((ProfileUIState2) => {
|
|
53
46
|
ProfileUIState2["LOADING"] = "LOADING";
|
|
@@ -78,6 +71,12 @@ var RoleType = /* @__PURE__ */ ((RoleType2) => {
|
|
|
78
71
|
RoleType2["ADMIN"] = "ADMIN";
|
|
79
72
|
return RoleType2;
|
|
80
73
|
})(RoleType || {});
|
|
74
|
+
var UserType = /* @__PURE__ */ ((UserType2) => {
|
|
75
|
+
UserType2["AUTHENTICATED"] = "AUTHENTICATED";
|
|
76
|
+
UserType2["PUBLIC"] = "PUBLIC";
|
|
77
|
+
UserType2["GUEST"] = "GUEST";
|
|
78
|
+
return UserType2;
|
|
79
|
+
})(UserType || {});
|
|
81
80
|
|
|
82
81
|
// src/types/event-bus/event-bus.interface.ts
|
|
83
82
|
var BaseEventBus = class {
|
|
@@ -95,6 +94,7 @@ var PageType = /* @__PURE__ */ ((PageType3) => {
|
|
|
95
94
|
PageType3["LOGIN"] = "/login";
|
|
96
95
|
PageType3["DASHBOARD"] = "dashboard";
|
|
97
96
|
PageType3["HOME"] = "/";
|
|
97
|
+
PageType3["EXCLUDED"] = "excluded";
|
|
98
98
|
return PageType3;
|
|
99
99
|
})(PageType || {});
|
|
100
100
|
var NavigationAction = /* @__PURE__ */ ((NavigationAction2) => {
|
|
@@ -126,6 +126,12 @@ var CrossTabBehaviorConfig = {
|
|
|
126
126
|
["auth.logged_out" /* LoggedOut */]: { action: "none" /* NONE */ },
|
|
127
127
|
["auth.email_verified" /* EmailVerified */]: { action: "none" /* NONE */ },
|
|
128
128
|
["auth.signin_required_modal" /* SignInRequiredModal */]: { action: "none" /* NONE */ }
|
|
129
|
+
},
|
|
130
|
+
["excluded" /* EXCLUDED */]: {
|
|
131
|
+
["auth.logged_in" /* LoggedIn */]: { action: "none" /* NONE */ },
|
|
132
|
+
["auth.logged_out" /* LoggedOut */]: { action: "none" /* NONE */ },
|
|
133
|
+
["auth.email_verified" /* EmailVerified */]: { action: "none" /* NONE */ },
|
|
134
|
+
["auth.signin_required_modal" /* SignInRequiredModal */]: { action: "none" /* NONE */ }
|
|
129
135
|
}
|
|
130
136
|
};
|
|
131
137
|
|
|
@@ -774,8 +780,8 @@ var useStepRenderer = () => {
|
|
|
774
780
|
|
|
775
781
|
|
|
776
782
|
|
|
777
|
-
var _image = require('next/image'); var _image2 = _interopRequireDefault(_image);
|
|
778
783
|
var _classvarianceauthority = require('class-variance-authority');
|
|
784
|
+
var _image = require('next/image'); var _image2 = _interopRequireDefault(_image);
|
|
779
785
|
|
|
780
786
|
// src/hooks/useAuthActionHandler.ts
|
|
781
787
|
|
|
@@ -1133,6 +1139,13 @@ var MiddlewareConfig = class {
|
|
|
1133
1139
|
{ hostPattern: null, pathPattern: this.CONSTANTS.LOGIN_PATH }
|
|
1134
1140
|
]);
|
|
1135
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
1144
|
+
* Format: "host:path" or "path"
|
|
1145
|
+
*/
|
|
1146
|
+
static getReloadExclusionRules() {
|
|
1147
|
+
return this.parseRules(process.env.NEXT_PUBLIC_RELOAD_EXCLUSION_ROUTES, []);
|
|
1148
|
+
}
|
|
1136
1149
|
/**
|
|
1137
1150
|
* Generic parser for environment variables containing rule lists
|
|
1138
1151
|
*/
|
|
@@ -1613,7 +1626,11 @@ var CrossTabBehaviorHandler = class {
|
|
|
1613
1626
|
if (typeof window === "undefined") return "/" /* HOME */;
|
|
1614
1627
|
try {
|
|
1615
1628
|
const pathname = window.location.pathname;
|
|
1629
|
+
const search = window.location.search;
|
|
1616
1630
|
const subdomain = UrlUtils.getSubdomain(window.location.hostname);
|
|
1631
|
+
if (this.isReloadExcluded(pathname, search, subdomain)) {
|
|
1632
|
+
return "excluded" /* EXCLUDED */;
|
|
1633
|
+
}
|
|
1617
1634
|
const pageTypeMatchers = {
|
|
1618
1635
|
["/login" /* LOGIN */]: pathname === MiddlewareConfig.CONSTANTS.LOGIN_PATH,
|
|
1619
1636
|
["dashboard" /* DASHBOARD */]: subdomain === MiddlewareConfig.CONSTANTS.DASHBOARD_SUBDOMAIN
|
|
@@ -1624,6 +1641,22 @@ var CrossTabBehaviorHandler = class {
|
|
|
1624
1641
|
return "dashboard" /* DASHBOARD */;
|
|
1625
1642
|
}
|
|
1626
1643
|
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Check if current route is excluded from automatic reload
|
|
1646
|
+
*/
|
|
1647
|
+
static isReloadExcluded(pathname, search, subdomain) {
|
|
1648
|
+
return MiddlewareConfig.getReloadExclusionRules().some((rule) => {
|
|
1649
|
+
const hostMatch = !rule.hostPattern || subdomain === rule.hostPattern;
|
|
1650
|
+
if (!hostMatch) return false;
|
|
1651
|
+
const [patternPath, patternParam] = rule.pathPattern.split("?");
|
|
1652
|
+
const isPathMatch = patternPath === "*" || pathname === patternPath || pathname.startsWith(patternPath);
|
|
1653
|
+
if (!isPathMatch) return false;
|
|
1654
|
+
if (patternParam) {
|
|
1655
|
+
return new URLSearchParams(search).has(patternParam);
|
|
1656
|
+
}
|
|
1657
|
+
return true;
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1627
1660
|
/**
|
|
1628
1661
|
* Get the action configuration for current route and event
|
|
1629
1662
|
*/
|
|
@@ -3064,12 +3097,19 @@ var useUserActions = () => {
|
|
|
3064
3097
|
return userSelectors.useActions();
|
|
3065
3098
|
};
|
|
3066
3099
|
var useAuth = () => {
|
|
3067
|
-
const isAuthenticated = userSelectors.
|
|
3068
|
-
const
|
|
3069
|
-
|
|
3070
|
-
|
|
3100
|
+
const { isAuthenticated, isLoading, error, user } = userSelectors.useUserState();
|
|
3101
|
+
const userType = _react.useMemo.call(void 0, () => {
|
|
3102
|
+
if (isAuthenticated) return "AUTHENTICATED" /* AUTHENTICATED */;
|
|
3103
|
+
if (isPublicUser(user == null ? void 0 : user.user)) return "PUBLIC" /* PUBLIC */;
|
|
3104
|
+
return "GUEST" /* GUEST */;
|
|
3105
|
+
}, [isAuthenticated, user]);
|
|
3071
3106
|
return {
|
|
3072
|
-
|
|
3107
|
+
authStatus: {
|
|
3108
|
+
type: userType,
|
|
3109
|
+
isAuthenticated,
|
|
3110
|
+
isPublic: userType === "PUBLIC" /* PUBLIC */,
|
|
3111
|
+
isGuest: userType === "GUEST" /* GUEST */
|
|
3112
|
+
},
|
|
3073
3113
|
isLoading,
|
|
3074
3114
|
error,
|
|
3075
3115
|
user
|
|
@@ -3210,12 +3250,11 @@ var useAuthFlowModal = () => {
|
|
|
3210
3250
|
var containerVariants = _classvarianceauthority.cva.call(void 0, "w-full h-screen p-6 overflow-hidden", {
|
|
3211
3251
|
variants: {
|
|
3212
3252
|
layout: {
|
|
3213
|
-
withImage: ""
|
|
3214
|
-
fullWidth: "max-w-[600px] mx-auto"
|
|
3253
|
+
withImage: ""
|
|
3215
3254
|
}
|
|
3216
3255
|
},
|
|
3217
3256
|
defaultVariants: {
|
|
3218
|
-
layout: "
|
|
3257
|
+
layout: "withImage"
|
|
3219
3258
|
}
|
|
3220
3259
|
});
|
|
3221
3260
|
var formContentVariants = _classvarianceauthority.cva.call(void 0, "overflow-auto w-full", {
|
|
@@ -3238,11 +3277,8 @@ var imageContainerVariants = _classvarianceauthority.cva.call(void 0, "h-screen
|
|
|
3238
3277
|
gradient: "purple"
|
|
3239
3278
|
}
|
|
3240
3279
|
});
|
|
3241
|
-
function AuthFlowContainer({
|
|
3242
|
-
|
|
3243
|
-
backgroundImage
|
|
3244
|
-
}) {
|
|
3245
|
-
const showRightSideImage = variant === "with_image" /* WITH_IMAGE */ && !!backgroundImage;
|
|
3280
|
+
function AuthFlowContainer({}) {
|
|
3281
|
+
const backgroundImage = process.env.NEXT_PUBLIC_AUTH_BACKGROUND_IMAGE || "";
|
|
3246
3282
|
const authOrchestrator = AuthOrchestratorFactory.create();
|
|
3247
3283
|
const eventBus = useSharedEventBus();
|
|
3248
3284
|
const { state: actionState, executeAction, clearAll } = useAuthActionHandler();
|
|
@@ -3502,13 +3538,13 @@ function AuthFlowContainer({
|
|
|
3502
3538
|
};
|
|
3503
3539
|
}, [stepperState.currentStep, stepperActions, clearAll, goBackToHome]);
|
|
3504
3540
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _antd.Row, { className: "m-0 h-screen", children: [
|
|
3505
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Col, { xs: 24, lg:
|
|
3541
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Col, { xs: 24, lg: 10, className: "flex flex-col", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3506
3542
|
_antd.Flex,
|
|
3507
3543
|
{
|
|
3508
3544
|
vertical: true,
|
|
3509
3545
|
justify: "space-between",
|
|
3510
3546
|
className: containerVariants({
|
|
3511
|
-
layout:
|
|
3547
|
+
layout: "withImage"
|
|
3512
3548
|
}),
|
|
3513
3549
|
children: [
|
|
3514
3550
|
config2.showBackToHome && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Flex, { justify: "flex-start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { onClick: topButton.onClick, shape: "round", size: "large", type: "primary", ghost: true, children: topButton.label }) }),
|
|
@@ -3539,7 +3575,7 @@ function AuthFlowContainer({
|
|
|
3539
3575
|
]
|
|
3540
3576
|
}
|
|
3541
3577
|
) }),
|
|
3542
|
-
|
|
3578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Col, { xs: 0, lg: 14, className: imageContainerVariants(), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Flex, { justify: "center", align: "center", className: "absolute top-0 left-0 w-full h-full p-10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Space, { className: "relative w-full h-full", children: backgroundImage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3543
3579
|
_image2.default,
|
|
3544
3580
|
{
|
|
3545
3581
|
src: backgroundImage,
|
|
@@ -3555,17 +3591,14 @@ function AuthFlowContainer({
|
|
|
3555
3591
|
// src/components/auth/auth-flow-modal.tsx
|
|
3556
3592
|
|
|
3557
3593
|
|
|
3558
|
-
function AuthFlowModal({
|
|
3559
|
-
children,
|
|
3560
|
-
variant = "default" /* DEFAULT */,
|
|
3561
|
-
backgroundImage
|
|
3562
|
-
}) {
|
|
3594
|
+
function AuthFlowModal({ children }) {
|
|
3563
3595
|
const { isModalOpen, isInitialLoading } = useAuthFlowModal();
|
|
3564
3596
|
if (isInitialLoading) {
|
|
3565
3597
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-h-screen flex items-center justify-center bg-gray-50", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Spin, { size: "large" }) });
|
|
3566
3598
|
}
|
|
3567
3599
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3568
|
-
isModalOpen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
3600
|
+
isModalOpen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: isModalOpen ? "hidden" : "", children }) : children,
|
|
3601
|
+
isModalOpen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "fixed inset-0 z-[999] min-h-screen flex items-center justify-center bg-gray-50", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Spin, { size: "large" }) }) : null,
|
|
3569
3602
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3570
3603
|
_antd.Modal,
|
|
3571
3604
|
{
|
|
@@ -3577,7 +3610,8 @@ function AuthFlowModal({
|
|
|
3577
3610
|
maskClosable: false,
|
|
3578
3611
|
closable: false,
|
|
3579
3612
|
className: "auth-flow-modal",
|
|
3580
|
-
|
|
3613
|
+
zIndex: 1e3,
|
|
3614
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AuthFlowContainer, {})
|
|
3581
3615
|
}
|
|
3582
3616
|
)
|
|
3583
3617
|
] });
|
|
@@ -3604,7 +3638,8 @@ var DefaultUnauthenticated = () => {
|
|
|
3604
3638
|
var UNAUTHENTICATED_COMPONENT_MAP = {
|
|
3605
3639
|
["dashboard" /* DASHBOARD */]: DefaultUnauthenticated,
|
|
3606
3640
|
["/login" /* LOGIN */]: DefaultUnauthenticated,
|
|
3607
|
-
["/" /* HOME */]: DefaultUnauthenticated
|
|
3641
|
+
["/" /* HOME */]: DefaultUnauthenticated,
|
|
3642
|
+
["excluded" /* EXCLUDED */]: DefaultUnauthenticated
|
|
3608
3643
|
};
|
|
3609
3644
|
var useUnauthenticatedStrategy = () => {
|
|
3610
3645
|
const [pageType, setPageType] = _react.useState.call(void 0, "/" /* HOME */);
|
|
@@ -3639,6 +3674,11 @@ var AuthenticatedState2 = ({ user, onLogout }) => {
|
|
|
3639
3674
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "font-medium", children: ((_c = (_b = user.user) == null ? void 0 : _b.role) == null ? void 0 : _c.name) || "N/A" })
|
|
3640
3675
|
] })
|
|
3641
3676
|
},
|
|
3677
|
+
dashboard: {
|
|
3678
|
+
key: "dashboard",
|
|
3679
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.DashboardOutlined, {}),
|
|
3680
|
+
label: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: UrlUtils.getDashboardUrl(window.location), children: "Go to Dashboard" })
|
|
3681
|
+
},
|
|
3642
3682
|
divider: {
|
|
3643
3683
|
type: "divider"
|
|
3644
3684
|
},
|
|
@@ -3650,7 +3690,7 @@ var AuthenticatedState2 = ({ user, onLogout }) => {
|
|
|
3650
3690
|
}
|
|
3651
3691
|
};
|
|
3652
3692
|
const userInfoMenu = {
|
|
3653
|
-
items: isPublic ? [menuItems.role, menuItems.divider] : [menuItems.email, menuItems.role, menuItems.divider, menuItems.logout]
|
|
3693
|
+
items: isPublic ? [menuItems.role, menuItems.divider] : [menuItems.email, menuItems.role, menuItems.divider, menuItems.dashboard, menuItems.logout]
|
|
3654
3694
|
};
|
|
3655
3695
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Dropdown, { menu: userInfoMenu, placement: "bottom", trigger: ["click"], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.Button, { type: "primary", shape: "circle", size: "large", icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.UserOutlined, {}) }) });
|
|
3656
3696
|
};
|
|
@@ -3671,7 +3711,8 @@ var getComponentProps = (state, user, callbacks) => {
|
|
|
3671
3711
|
}
|
|
3672
3712
|
};
|
|
3673
3713
|
var ProfileStateRenderer = () => {
|
|
3674
|
-
const { user, isLoading,
|
|
3714
|
+
const { user, isLoading, authStatus } = useAuth();
|
|
3715
|
+
const { isAuthenticated } = authStatus;
|
|
3675
3716
|
const logout = useLogout();
|
|
3676
3717
|
const currentState = resolveState(isLoading, isAuthenticated, user);
|
|
3677
3718
|
const componentProps = getComponentProps(currentState, user, {
|
|
@@ -3695,7 +3736,8 @@ var ProfileStateRenderer = () => {
|
|
|
3695
3736
|
var { Title: Title3, Text: Text2, Paragraph: Paragraph2 } = _antd.Typography;
|
|
3696
3737
|
var CrossTabDemo = () => {
|
|
3697
3738
|
var _a;
|
|
3698
|
-
const {
|
|
3739
|
+
const { authStatus, user } = useAuth();
|
|
3740
|
+
const { isAuthenticated } = authStatus;
|
|
3699
3741
|
const currentPageType = CrossTabBehaviorHandler.getCurrentPageType();
|
|
3700
3742
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3701
3743
|
_antd.Card,
|
|
@@ -3956,7 +3998,7 @@ var getForgotPasswordField = (options = {}) => ({
|
|
|
3956
3998
|
|
|
3957
3999
|
|
|
3958
4000
|
|
|
3959
|
-
exports.AUTH_ENDPOINTS = AUTH_ENDPOINTS; exports.AlertDisplay = AlertDisplay; exports.ApiErrorHandler = ApiErrorHandler; exports.AuthEventType = AuthEventType; exports.AuthFlowContainer = AuthFlowContainer; exports.AuthFlowModal = AuthFlowModal; exports.AuthFlowStep = AuthFlowStep; exports.
|
|
4001
|
+
exports.AUTH_ENDPOINTS = AUTH_ENDPOINTS; exports.AlertDisplay = AlertDisplay; exports.ApiErrorHandler = ApiErrorHandler; exports.AuthEventType = AuthEventType; exports.AuthFlowContainer = AuthFlowContainer; exports.AuthFlowModal = AuthFlowModal; exports.AuthFlowStep = AuthFlowStep; exports.AuthInitializer = AuthInitializer; exports.AuthOrchestrator = AuthOrchestrator; exports.AuthOrchestratorFactory = AuthOrchestratorFactory; exports.AuthResultFactory = AuthResultFactory; exports.AuthService = AuthService; exports.AuthenticatedState = AuthenticatedState; exports.AuthenticationStatusContext = AuthenticationStatusContext; exports.BaseErrorHandler = BaseErrorHandler; exports.BaseEventBus = BaseEventBus; exports.BaseForm = BaseForm; exports.BaseService = BaseService; exports.BroadcastChannelEventBus = BroadcastChannelEventBus; exports.Channel = Channel; exports.CookieUtils = CookieUtils; exports.CrossTabBehaviorConfig = CrossTabBehaviorConfig; exports.CrossTabBehaviorHandler = CrossTabBehaviorHandler; exports.CrossTabDemo = CrossTabDemo; exports.DevelopmentLogger = DevelopmentLogger; exports.EMAIL_SUBMISSION_NAVIGATION = EMAIL_SUBMISSION_NAVIGATION; exports.EmailProviderUtils = EmailProviderUtils; exports.EmailStep = EmailStep; exports.EndpointBuilder = EndpointBuilder; exports.ExistingUserLoginStrategy = ExistingUserLoginStrategy; exports.FormFields = FormFields; exports.FormHeader = FormHeader; exports.HttpClient = HttpClient; exports.HttpMethod = HttpMethod; exports.LocalStorageUtils = LocalStorageUtils; exports.LoggerFactory = LoggerFactory; exports.LoginFlowStrategyFactory = LoginFlowStrategyFactory; exports.LoginStrategyResolver = LoginStrategyResolver; exports.LoginVerificationStrategy = LoginVerificationStrategy; exports.MiddlewareConfig = MiddlewareConfig; exports.NavigationAction = NavigationAction; exports.NetworkErrorHandler = NetworkErrorHandler; exports.NextAction = NextAction; exports.PASSWORD_SUBMISSION_NAVIGATION = PASSWORD_SUBMISSION_NAVIGATION; exports.PageType = PageType; exports.PageTypePatterns = PageTypePatterns; exports.PasswordInputWithStrength = PasswordInputWithStrength; exports.PasswordStep = PasswordStep; exports.ProductionLogger = ProductionLogger; exports.ProfileStateRenderer = ProfileStateRenderer; exports.ProfileUIState = ProfileUIState; exports.RoleType = RoleType; exports.SignupFlowStrategy = SignupFlowStrategy; exports.StrategyResolutionMode = StrategyResolutionMode; exports.TokenManager = TokenManager; exports.UnauthenticatedState = UnauthenticatedState; exports.UrlCleanupHandler = UrlCleanupHandler; exports.UrlUtils = UrlUtils; exports.UserStorageManager = UserStorageManager; exports.UserType = UserType; exports.VERIFICATION_SUBMISSION_NAVIGATION = VERIFICATION_SUBMISSION_NAVIGATION; exports.VerificationStep = VerificationStep; exports.config = config; exports.createAuthSteps = createAuthSteps; exports.createPropsFactoryRegistry = createPropsFactoryRegistry; exports.createStepRegistry = createStepRegistry; exports.getAuthPageStepMessage = getAuthPageStepMessage; exports.getEmailField = getEmailField; exports.getForgotPasswordField = getForgotPasswordField; exports.getPasswordField = getPasswordField; exports.getStepForEmailSubmission = getStepForEmailSubmission; exports.getStepForPasswordSubmission = getStepForPasswordSubmission; exports.getStepForVerificationSubmission = getStepForVerificationSubmission; exports.getStepProgressMessage = getStepProgressMessage; exports.getTermsCheckboxField = getTermsCheckboxField; exports.getVerificationField = getVerificationField; exports.isPublicUser = isPublicUser; exports.isPublicUserEmail = isPublicUserEmail; exports.middlewareMatcher = middlewareMatcher; exports.useAuth = useAuth; exports.useAuthActionHandler = useAuthActionHandler; exports.useAuthEventBus = useAuthEventBus; exports.useAuthFlowModal = useAuthFlowModal; exports.useAuthInitializer = useAuthInitializer; exports.useIsAuthenticated = useIsAuthenticated; exports.useLogout = useLogout; exports.usePublicUserSession = usePublicUserSession; exports.useRefreshUser = useRefreshUser; exports.useSharedEventBus = useSharedEventBus; exports.useSignInRequiredParams = useSignInRequiredParams; exports.useStepRegistry = useStepRegistry; exports.useStepRenderer = useStepRenderer; exports.useStepper = useStepper; exports.useUser = useUser; exports.useUserActions = useUserActions; exports.useUserData = useUserData; exports.useUserError = useUserError; exports.useUserLoading = useUserLoading; exports.useUserProfile = useUserProfile; exports.useUserSelectors = useUserSelectors; exports.useUserStore = useUserStore; exports.userSelectors = userSelectors;
|
|
3960
4002
|
/*! Bundled license information:
|
|
3961
4003
|
|
|
3962
4004
|
js-cookie/dist/js.cookie.mjs:
|
package/dist/index.mjs
CHANGED
|
@@ -41,13 +41,6 @@ var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
|
41
41
|
return HttpMethod2;
|
|
42
42
|
})(HttpMethod || {});
|
|
43
43
|
|
|
44
|
-
// src/types/components/auth-flow.ts
|
|
45
|
-
var AuthFlowVariant = /* @__PURE__ */ ((AuthFlowVariant2) => {
|
|
46
|
-
AuthFlowVariant2["DEFAULT"] = "default";
|
|
47
|
-
AuthFlowVariant2["WITH_IMAGE"] = "with_image";
|
|
48
|
-
return AuthFlowVariant2;
|
|
49
|
-
})(AuthFlowVariant || {});
|
|
50
|
-
|
|
51
44
|
// src/types/components/profile.ts
|
|
52
45
|
var ProfileUIState = /* @__PURE__ */ ((ProfileUIState2) => {
|
|
53
46
|
ProfileUIState2["LOADING"] = "LOADING";
|
|
@@ -78,6 +71,12 @@ var RoleType = /* @__PURE__ */ ((RoleType2) => {
|
|
|
78
71
|
RoleType2["ADMIN"] = "ADMIN";
|
|
79
72
|
return RoleType2;
|
|
80
73
|
})(RoleType || {});
|
|
74
|
+
var UserType = /* @__PURE__ */ ((UserType2) => {
|
|
75
|
+
UserType2["AUTHENTICATED"] = "AUTHENTICATED";
|
|
76
|
+
UserType2["PUBLIC"] = "PUBLIC";
|
|
77
|
+
UserType2["GUEST"] = "GUEST";
|
|
78
|
+
return UserType2;
|
|
79
|
+
})(UserType || {});
|
|
81
80
|
|
|
82
81
|
// src/types/event-bus/event-bus.interface.ts
|
|
83
82
|
var BaseEventBus = class {
|
|
@@ -95,6 +94,7 @@ var PageType = /* @__PURE__ */ ((PageType3) => {
|
|
|
95
94
|
PageType3["LOGIN"] = "/login";
|
|
96
95
|
PageType3["DASHBOARD"] = "dashboard";
|
|
97
96
|
PageType3["HOME"] = "/";
|
|
97
|
+
PageType3["EXCLUDED"] = "excluded";
|
|
98
98
|
return PageType3;
|
|
99
99
|
})(PageType || {});
|
|
100
100
|
var NavigationAction = /* @__PURE__ */ ((NavigationAction2) => {
|
|
@@ -126,6 +126,12 @@ var CrossTabBehaviorConfig = {
|
|
|
126
126
|
["auth.logged_out" /* LoggedOut */]: { action: "none" /* NONE */ },
|
|
127
127
|
["auth.email_verified" /* EmailVerified */]: { action: "none" /* NONE */ },
|
|
128
128
|
["auth.signin_required_modal" /* SignInRequiredModal */]: { action: "none" /* NONE */ }
|
|
129
|
+
},
|
|
130
|
+
["excluded" /* EXCLUDED */]: {
|
|
131
|
+
["auth.logged_in" /* LoggedIn */]: { action: "none" /* NONE */ },
|
|
132
|
+
["auth.logged_out" /* LoggedOut */]: { action: "none" /* NONE */ },
|
|
133
|
+
["auth.email_verified" /* EmailVerified */]: { action: "none" /* NONE */ },
|
|
134
|
+
["auth.signin_required_modal" /* SignInRequiredModal */]: { action: "none" /* NONE */ }
|
|
129
135
|
}
|
|
130
136
|
};
|
|
131
137
|
|
|
@@ -774,8 +780,8 @@ var useStepRenderer = () => {
|
|
|
774
780
|
import React5, { useState as useState7 } from "react";
|
|
775
781
|
import { Steps, Col, Button as Button5, Flex as Flex3, Row, Space as Space4, message } from "antd";
|
|
776
782
|
import { ArrowLeftOutlined as ArrowLeftOutlined2 } from "@ant-design/icons";
|
|
777
|
-
import Image from "next/image";
|
|
778
783
|
import { cva } from "class-variance-authority";
|
|
784
|
+
import Image from "next/image";
|
|
779
785
|
|
|
780
786
|
// src/hooks/useAuthActionHandler.ts
|
|
781
787
|
import { useState as useState4, useCallback as useCallback2 } from "react";
|
|
@@ -1133,6 +1139,13 @@ var MiddlewareConfig = class {
|
|
|
1133
1139
|
{ hostPattern: null, pathPattern: this.CONSTANTS.LOGIN_PATH }
|
|
1134
1140
|
]);
|
|
1135
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
1144
|
+
* Format: "host:path" or "path"
|
|
1145
|
+
*/
|
|
1146
|
+
static getReloadExclusionRules() {
|
|
1147
|
+
return this.parseRules(process.env.NEXT_PUBLIC_RELOAD_EXCLUSION_ROUTES, []);
|
|
1148
|
+
}
|
|
1136
1149
|
/**
|
|
1137
1150
|
* Generic parser for environment variables containing rule lists
|
|
1138
1151
|
*/
|
|
@@ -1613,7 +1626,11 @@ var CrossTabBehaviorHandler = class {
|
|
|
1613
1626
|
if (typeof window === "undefined") return "/" /* HOME */;
|
|
1614
1627
|
try {
|
|
1615
1628
|
const pathname = window.location.pathname;
|
|
1629
|
+
const search = window.location.search;
|
|
1616
1630
|
const subdomain = UrlUtils.getSubdomain(window.location.hostname);
|
|
1631
|
+
if (this.isReloadExcluded(pathname, search, subdomain)) {
|
|
1632
|
+
return "excluded" /* EXCLUDED */;
|
|
1633
|
+
}
|
|
1617
1634
|
const pageTypeMatchers = {
|
|
1618
1635
|
["/login" /* LOGIN */]: pathname === MiddlewareConfig.CONSTANTS.LOGIN_PATH,
|
|
1619
1636
|
["dashboard" /* DASHBOARD */]: subdomain === MiddlewareConfig.CONSTANTS.DASHBOARD_SUBDOMAIN
|
|
@@ -1624,6 +1641,22 @@ var CrossTabBehaviorHandler = class {
|
|
|
1624
1641
|
return "dashboard" /* DASHBOARD */;
|
|
1625
1642
|
}
|
|
1626
1643
|
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Check if current route is excluded from automatic reload
|
|
1646
|
+
*/
|
|
1647
|
+
static isReloadExcluded(pathname, search, subdomain) {
|
|
1648
|
+
return MiddlewareConfig.getReloadExclusionRules().some((rule) => {
|
|
1649
|
+
const hostMatch = !rule.hostPattern || subdomain === rule.hostPattern;
|
|
1650
|
+
if (!hostMatch) return false;
|
|
1651
|
+
const [patternPath, patternParam] = rule.pathPattern.split("?");
|
|
1652
|
+
const isPathMatch = patternPath === "*" || pathname === patternPath || pathname.startsWith(patternPath);
|
|
1653
|
+
if (!isPathMatch) return false;
|
|
1654
|
+
if (patternParam) {
|
|
1655
|
+
return new URLSearchParams(search).has(patternParam);
|
|
1656
|
+
}
|
|
1657
|
+
return true;
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1627
1660
|
/**
|
|
1628
1661
|
* Get the action configuration for current route and event
|
|
1629
1662
|
*/
|
|
@@ -2814,7 +2847,7 @@ function useSignInRequiredParams() {
|
|
|
2814
2847
|
}
|
|
2815
2848
|
|
|
2816
2849
|
// src/hooks/use-user.ts
|
|
2817
|
-
import { useEffect as useEffect6 } from "react";
|
|
2850
|
+
import { useEffect as useEffect6, useMemo as useMemo6 } from "react";
|
|
2818
2851
|
|
|
2819
2852
|
// src/store/user-store.ts
|
|
2820
2853
|
import { create } from "zustand";
|
|
@@ -3064,12 +3097,19 @@ var useUserActions = () => {
|
|
|
3064
3097
|
return userSelectors.useActions();
|
|
3065
3098
|
};
|
|
3066
3099
|
var useAuth = () => {
|
|
3067
|
-
const isAuthenticated = userSelectors.
|
|
3068
|
-
const
|
|
3069
|
-
|
|
3070
|
-
|
|
3100
|
+
const { isAuthenticated, isLoading, error, user } = userSelectors.useUserState();
|
|
3101
|
+
const userType = useMemo6(() => {
|
|
3102
|
+
if (isAuthenticated) return "AUTHENTICATED" /* AUTHENTICATED */;
|
|
3103
|
+
if (isPublicUser(user == null ? void 0 : user.user)) return "PUBLIC" /* PUBLIC */;
|
|
3104
|
+
return "GUEST" /* GUEST */;
|
|
3105
|
+
}, [isAuthenticated, user]);
|
|
3071
3106
|
return {
|
|
3072
|
-
|
|
3107
|
+
authStatus: {
|
|
3108
|
+
type: userType,
|
|
3109
|
+
isAuthenticated,
|
|
3110
|
+
isPublic: userType === "PUBLIC" /* PUBLIC */,
|
|
3111
|
+
isGuest: userType === "GUEST" /* GUEST */
|
|
3112
|
+
},
|
|
3073
3113
|
isLoading,
|
|
3074
3114
|
error,
|
|
3075
3115
|
user
|
|
@@ -3210,12 +3250,11 @@ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
|
3210
3250
|
var containerVariants = cva("w-full h-screen p-6 overflow-hidden", {
|
|
3211
3251
|
variants: {
|
|
3212
3252
|
layout: {
|
|
3213
|
-
withImage: ""
|
|
3214
|
-
fullWidth: "max-w-[600px] mx-auto"
|
|
3253
|
+
withImage: ""
|
|
3215
3254
|
}
|
|
3216
3255
|
},
|
|
3217
3256
|
defaultVariants: {
|
|
3218
|
-
layout: "
|
|
3257
|
+
layout: "withImage"
|
|
3219
3258
|
}
|
|
3220
3259
|
});
|
|
3221
3260
|
var formContentVariants = cva("overflow-auto w-full", {
|
|
@@ -3238,11 +3277,8 @@ var imageContainerVariants = cva("h-screen overflow-hidden relative", {
|
|
|
3238
3277
|
gradient: "purple"
|
|
3239
3278
|
}
|
|
3240
3279
|
});
|
|
3241
|
-
function AuthFlowContainer({
|
|
3242
|
-
|
|
3243
|
-
backgroundImage
|
|
3244
|
-
}) {
|
|
3245
|
-
const showRightSideImage = variant === "with_image" /* WITH_IMAGE */ && !!backgroundImage;
|
|
3280
|
+
function AuthFlowContainer({}) {
|
|
3281
|
+
const backgroundImage = process.env.NEXT_PUBLIC_AUTH_BACKGROUND_IMAGE || "";
|
|
3246
3282
|
const authOrchestrator = AuthOrchestratorFactory.create();
|
|
3247
3283
|
const eventBus = useSharedEventBus();
|
|
3248
3284
|
const { state: actionState, executeAction, clearAll } = useAuthActionHandler();
|
|
@@ -3502,13 +3538,13 @@ function AuthFlowContainer({
|
|
|
3502
3538
|
};
|
|
3503
3539
|
}, [stepperState.currentStep, stepperActions, clearAll, goBackToHome]);
|
|
3504
3540
|
return /* @__PURE__ */ jsxs6(Row, { className: "m-0 h-screen", children: [
|
|
3505
|
-
/* @__PURE__ */ jsx12(Col, { xs: 24, lg:
|
|
3541
|
+
/* @__PURE__ */ jsx12(Col, { xs: 24, lg: 10, className: "flex flex-col", children: /* @__PURE__ */ jsxs6(
|
|
3506
3542
|
Flex3,
|
|
3507
3543
|
{
|
|
3508
3544
|
vertical: true,
|
|
3509
3545
|
justify: "space-between",
|
|
3510
3546
|
className: containerVariants({
|
|
3511
|
-
layout:
|
|
3547
|
+
layout: "withImage"
|
|
3512
3548
|
}),
|
|
3513
3549
|
children: [
|
|
3514
3550
|
config2.showBackToHome && /* @__PURE__ */ jsx12(Flex3, { justify: "flex-start", children: /* @__PURE__ */ jsx12(Button5, { onClick: topButton.onClick, shape: "round", size: "large", type: "primary", ghost: true, children: topButton.label }) }),
|
|
@@ -3539,7 +3575,7 @@ function AuthFlowContainer({
|
|
|
3539
3575
|
]
|
|
3540
3576
|
}
|
|
3541
3577
|
) }),
|
|
3542
|
-
|
|
3578
|
+
/* @__PURE__ */ jsx12(Col, { xs: 0, lg: 14, className: imageContainerVariants(), children: /* @__PURE__ */ jsx12(Flex3, { justify: "center", align: "center", className: "absolute top-0 left-0 w-full h-full p-10", children: /* @__PURE__ */ jsx12(Space4, { className: "relative w-full h-full", children: backgroundImage && /* @__PURE__ */ jsx12(
|
|
3543
3579
|
Image,
|
|
3544
3580
|
{
|
|
3545
3581
|
src: backgroundImage,
|
|
@@ -3555,17 +3591,14 @@ function AuthFlowContainer({
|
|
|
3555
3591
|
// src/components/auth/auth-flow-modal.tsx
|
|
3556
3592
|
import { Modal, Spin as Spin2 } from "antd";
|
|
3557
3593
|
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3558
|
-
function AuthFlowModal({
|
|
3559
|
-
children,
|
|
3560
|
-
variant = "default" /* DEFAULT */,
|
|
3561
|
-
backgroundImage
|
|
3562
|
-
}) {
|
|
3594
|
+
function AuthFlowModal({ children }) {
|
|
3563
3595
|
const { isModalOpen, isInitialLoading } = useAuthFlowModal();
|
|
3564
3596
|
if (isInitialLoading) {
|
|
3565
3597
|
return /* @__PURE__ */ jsx13("div", { className: "min-h-screen flex items-center justify-center bg-gray-50", children: /* @__PURE__ */ jsx13(Spin2, { size: "large" }) });
|
|
3566
3598
|
}
|
|
3567
3599
|
return /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
3568
|
-
isModalOpen ? /* @__PURE__ */ jsx13("div", { className:
|
|
3600
|
+
isModalOpen ? /* @__PURE__ */ jsx13("div", { className: isModalOpen ? "hidden" : "", children }) : children,
|
|
3601
|
+
isModalOpen ? /* @__PURE__ */ jsx13("div", { className: "fixed inset-0 z-[999] min-h-screen flex items-center justify-center bg-gray-50", children: /* @__PURE__ */ jsx13(Spin2, { size: "large" }) }) : null,
|
|
3569
3602
|
/* @__PURE__ */ jsx13(
|
|
3570
3603
|
Modal,
|
|
3571
3604
|
{
|
|
@@ -3577,7 +3610,8 @@ function AuthFlowModal({
|
|
|
3577
3610
|
maskClosable: false,
|
|
3578
3611
|
closable: false,
|
|
3579
3612
|
className: "auth-flow-modal",
|
|
3580
|
-
|
|
3613
|
+
zIndex: 1e3,
|
|
3614
|
+
children: /* @__PURE__ */ jsx13(AuthFlowContainer, {})
|
|
3581
3615
|
}
|
|
3582
3616
|
)
|
|
3583
3617
|
] });
|
|
@@ -3593,7 +3627,7 @@ var AuthInitializer = ({ children }) => {
|
|
|
3593
3627
|
// src/components/profile/profile-state-renderer.tsx
|
|
3594
3628
|
import { useState as useState8, useEffect as useEffect8 } from "react";
|
|
3595
3629
|
import { Dropdown, Button as Button6 } from "antd";
|
|
3596
|
-
import { MailOutlined, CrownOutlined, LogoutOutlined, UserOutlined } from "@ant-design/icons";
|
|
3630
|
+
import { MailOutlined, CrownOutlined, LogoutOutlined, UserOutlined, DashboardOutlined } from "@ant-design/icons";
|
|
3597
3631
|
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3598
3632
|
var DefaultUnauthenticated = () => {
|
|
3599
3633
|
const rootDomain = UrlUtils.getRootDomain(window.location.hostname);
|
|
@@ -3604,7 +3638,8 @@ var DefaultUnauthenticated = () => {
|
|
|
3604
3638
|
var UNAUTHENTICATED_COMPONENT_MAP = {
|
|
3605
3639
|
["dashboard" /* DASHBOARD */]: DefaultUnauthenticated,
|
|
3606
3640
|
["/login" /* LOGIN */]: DefaultUnauthenticated,
|
|
3607
|
-
["/" /* HOME */]: DefaultUnauthenticated
|
|
3641
|
+
["/" /* HOME */]: DefaultUnauthenticated,
|
|
3642
|
+
["excluded" /* EXCLUDED */]: DefaultUnauthenticated
|
|
3608
3643
|
};
|
|
3609
3644
|
var useUnauthenticatedStrategy = () => {
|
|
3610
3645
|
const [pageType, setPageType] = useState8("/" /* HOME */);
|
|
@@ -3639,6 +3674,11 @@ var AuthenticatedState2 = ({ user, onLogout }) => {
|
|
|
3639
3674
|
/* @__PURE__ */ jsx15("div", { className: "font-medium", children: ((_c = (_b = user.user) == null ? void 0 : _b.role) == null ? void 0 : _c.name) || "N/A" })
|
|
3640
3675
|
] })
|
|
3641
3676
|
},
|
|
3677
|
+
dashboard: {
|
|
3678
|
+
key: "dashboard",
|
|
3679
|
+
icon: /* @__PURE__ */ jsx15(DashboardOutlined, {}),
|
|
3680
|
+
label: /* @__PURE__ */ jsx15("a", { href: UrlUtils.getDashboardUrl(window.location), children: "Go to Dashboard" })
|
|
3681
|
+
},
|
|
3642
3682
|
divider: {
|
|
3643
3683
|
type: "divider"
|
|
3644
3684
|
},
|
|
@@ -3650,7 +3690,7 @@ var AuthenticatedState2 = ({ user, onLogout }) => {
|
|
|
3650
3690
|
}
|
|
3651
3691
|
};
|
|
3652
3692
|
const userInfoMenu = {
|
|
3653
|
-
items: isPublic ? [menuItems.role, menuItems.divider] : [menuItems.email, menuItems.role, menuItems.divider, menuItems.logout]
|
|
3693
|
+
items: isPublic ? [menuItems.role, menuItems.divider] : [menuItems.email, menuItems.role, menuItems.divider, menuItems.dashboard, menuItems.logout]
|
|
3654
3694
|
};
|
|
3655
3695
|
return /* @__PURE__ */ jsx15(Dropdown, { menu: userInfoMenu, placement: "bottom", trigger: ["click"], children: /* @__PURE__ */ jsx15(Button6, { type: "primary", shape: "circle", size: "large", icon: /* @__PURE__ */ jsx15(UserOutlined, {}) }) });
|
|
3656
3696
|
};
|
|
@@ -3671,7 +3711,8 @@ var getComponentProps = (state, user, callbacks) => {
|
|
|
3671
3711
|
}
|
|
3672
3712
|
};
|
|
3673
3713
|
var ProfileStateRenderer = () => {
|
|
3674
|
-
const { user, isLoading,
|
|
3714
|
+
const { user, isLoading, authStatus } = useAuth();
|
|
3715
|
+
const { isAuthenticated } = authStatus;
|
|
3675
3716
|
const logout = useLogout();
|
|
3676
3717
|
const currentState = resolveState(isLoading, isAuthenticated, user);
|
|
3677
3718
|
const componentProps = getComponentProps(currentState, user, {
|
|
@@ -3695,7 +3736,8 @@ import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-ru
|
|
|
3695
3736
|
var { Title: Title3, Text: Text2, Paragraph: Paragraph2 } = Typography4;
|
|
3696
3737
|
var CrossTabDemo = () => {
|
|
3697
3738
|
var _a;
|
|
3698
|
-
const {
|
|
3739
|
+
const { authStatus, user } = useAuth();
|
|
3740
|
+
const { isAuthenticated } = authStatus;
|
|
3699
3741
|
const currentPageType = CrossTabBehaviorHandler.getCurrentPageType();
|
|
3700
3742
|
return /* @__PURE__ */ jsx16(
|
|
3701
3743
|
Card,
|
|
@@ -3861,7 +3903,6 @@ export {
|
|
|
3861
3903
|
AuthFlowContainer,
|
|
3862
3904
|
AuthFlowModal,
|
|
3863
3905
|
AuthFlowStep,
|
|
3864
|
-
AuthFlowVariant,
|
|
3865
3906
|
AuthInitializer,
|
|
3866
3907
|
AuthOrchestrator,
|
|
3867
3908
|
AuthOrchestratorFactory,
|
|
@@ -3914,6 +3955,7 @@ export {
|
|
|
3914
3955
|
UrlCleanupHandler,
|
|
3915
3956
|
UrlUtils,
|
|
3916
3957
|
UserStorageManager,
|
|
3958
|
+
UserType,
|
|
3917
3959
|
VERIFICATION_SUBMISSION_NAVIGATION,
|
|
3918
3960
|
VerificationStep,
|
|
3919
3961
|
config,
|
package/dist/middleware.mjs
CHANGED
|
@@ -32,6 +32,13 @@ var MiddlewareConfig = class {
|
|
|
32
32
|
{ hostPattern: null, pathPattern: this.CONSTANTS.LOGIN_PATH }
|
|
33
33
|
]);
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
37
|
+
* Format: "host:path" or "path"
|
|
38
|
+
*/
|
|
39
|
+
static getReloadExclusionRules() {
|
|
40
|
+
return this.parseRules(process.env.NEXT_PUBLIC_RELOAD_EXCLUSION_ROUTES, []);
|
|
41
|
+
}
|
|
35
42
|
/**
|
|
36
43
|
* Generic parser for environment variables containing rule lists
|
|
37
44
|
*/
|
|
@@ -30,6 +30,13 @@ var MiddlewareConfig = class {
|
|
|
30
30
|
{ hostPattern: null, pathPattern: this.CONSTANTS.LOGIN_PATH }
|
|
31
31
|
]);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
35
|
+
* Format: "host:path" or "path"
|
|
36
|
+
*/
|
|
37
|
+
static getReloadExclusionRules() {
|
|
38
|
+
return this.parseRules(process.env.NEXT_PUBLIC_RELOAD_EXCLUSION_ROUTES, []);
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
41
|
* Generic parser for environment variables containing rule lists
|
|
35
42
|
*/
|
|
@@ -30,6 +30,13 @@ var MiddlewareConfig = class {
|
|
|
30
30
|
{ hostPattern: null, pathPattern: this.CONSTANTS.LOGIN_PATH }
|
|
31
31
|
]);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Get reload exclusion rules (routes that shouldn't auto-reload on login)
|
|
35
|
+
* Format: "host:path" or "path"
|
|
36
|
+
*/
|
|
37
|
+
static getReloadExclusionRules() {
|
|
38
|
+
return this.parseRules(process.env.NEXT_PUBLIC_RELOAD_EXCLUSION_ROUTES, []);
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
41
|
* Generic parser for environment variables containing rule lists
|
|
35
42
|
*/
|
package/package.json
CHANGED