mailsentry-auth 0.2.1 → 0.2.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/dist/index.js CHANGED
@@ -65,11 +65,11 @@ var AuthFlowStep = /* @__PURE__ */ ((AuthFlowStep2) => {
65
65
  AuthFlowStep2["FORGOT_PASSWORD"] = "forgot-password";
66
66
  return AuthFlowStep2;
67
67
  })(AuthFlowStep || {});
68
- var NextAction = /* @__PURE__ */ ((NextAction2) => {
69
- NextAction2["LOGIN"] = "login";
70
- NextAction2["SIGNUP"] = "signup";
71
- NextAction2["LOGIN_VERIFICATION"] = "login-verification";
72
- return NextAction2;
68
+ var NextAction = /* @__PURE__ */ ((NextAction3) => {
69
+ NextAction3["LOGIN"] = "login";
70
+ NextAction3["SIGNUP"] = "signup";
71
+ NextAction3["LOGIN_VERIFICATION"] = "login-verification";
72
+ return NextAction3;
73
73
  })(NextAction || {});
74
74
 
75
75
  // src/types/auth/auth-types.ts
@@ -2134,6 +2134,21 @@ var ExistingUserLoginStrategy = class {
2134
2134
  }
2135
2135
  };
2136
2136
 
2137
+ // src/services/auth/patterns/strategy/login-verification-strategy.ts
2138
+ var LoginVerificationStrategy = class {
2139
+ constructor(authService, tokenManager) {
2140
+ this.authService = authService;
2141
+ this.tokenManager = tokenManager;
2142
+ }
2143
+ async execute(credentials) {
2144
+ const loginResult = await this.authService.login(credentials);
2145
+ return AuthResultFactory.createSuccess(__spreadProps(__spreadValues({}, loginResult.data), {
2146
+ verification_required: true,
2147
+ message: "Please verify your email to continue"
2148
+ }));
2149
+ }
2150
+ };
2151
+
2137
2152
  // src/services/auth/patterns/strategy/login-flow-strategy-factory.ts
2138
2153
  var LoginFlowStrategyFactory = class {
2139
2154
  static createStrategy(action, authService, tokenManager) {
@@ -2146,9 +2161,53 @@ var LoginFlowStrategyFactory = class {
2146
2161
  };
2147
2162
  LoginFlowStrategyFactory.strategies = /* @__PURE__ */ new Map([
2148
2163
  ["signup" /* SIGNUP */, (authService, tokenManager) => new SignupFlowStrategy(authService, tokenManager)],
2149
- ["login" /* LOGIN */, (authService, tokenManager) => new ExistingUserLoginStrategy(authService, tokenManager)]
2164
+ ["login" /* LOGIN */, (authService, tokenManager) => new ExistingUserLoginStrategy(authService, tokenManager)],
2165
+ ["login-verification" /* LOGIN_VERIFICATION */, (authService, tokenManager) => new LoginVerificationStrategy(authService, tokenManager)]
2150
2166
  ]);
2151
2167
 
2168
+ // src/services/auth/patterns/strategy/login-strategy-resolver.ts
2169
+ var StrategyResolutionMode = /* @__PURE__ */ ((StrategyResolutionMode2) => {
2170
+ StrategyResolutionMode2["SKIP_EMAIL_CHECK"] = "SKIP_EMAIL_CHECK";
2171
+ StrategyResolutionMode2["CHECK_EMAIL_EXISTS"] = "CHECK_EMAIL_EXISTS";
2172
+ return StrategyResolutionMode2;
2173
+ })(StrategyResolutionMode || {});
2174
+ var SkipEmailCheckCommand = class {
2175
+ async execute(_email) {
2176
+ return "login" /* LOGIN */;
2177
+ }
2178
+ };
2179
+ var CheckEmailExistsCommand = class {
2180
+ constructor(authService) {
2181
+ this.authService = authService;
2182
+ }
2183
+ async execute(email) {
2184
+ const emailCheck = await this.authService.checkEmailExists(email);
2185
+ return emailCheck.next_action;
2186
+ }
2187
+ };
2188
+ var LoginStrategyResolver = class {
2189
+ constructor(authService) {
2190
+ this.strategies = /* @__PURE__ */ new Map([
2191
+ ["SKIP_EMAIL_CHECK" /* SKIP_EMAIL_CHECK */, new SkipEmailCheckCommand()],
2192
+ ["CHECK_EMAIL_EXISTS" /* CHECK_EMAIL_EXISTS */, new CheckEmailExistsCommand(authService)]
2193
+ ]);
2194
+ }
2195
+ async resolve(email, mode) {
2196
+ const command = this.strategies.get(mode);
2197
+ if (!command) {
2198
+ throw new Error(`No strategy found for mode: ${mode}`);
2199
+ }
2200
+ return await command.execute(email);
2201
+ }
2202
+ /**
2203
+ * Extend resolver with new strategies at runtime
2204
+ * Example: resolver.registerStrategy(StrategyResolutionMode.CUSTOM, customCommand)
2205
+ */
2206
+ registerStrategy(mode, command) {
2207
+ this.strategies.set(mode, command);
2208
+ }
2209
+ };
2210
+
2152
2211
  // src/services/auth/patterns/state/authenticated-state.ts
2153
2212
  var AuthenticatedState = class {
2154
2213
  async getStatus(tokenManager) {
@@ -2290,12 +2349,15 @@ var AuthOrchestrator = class {
2290
2349
  }
2291
2350
  /**
2292
2351
  * Handle complete login flow with proper error handling and token management
2352
+ * @param credentials - Login credentials (email and password)
2353
+ * @param mode - Strategy resolution mode (defaults to CHECK_EMAIL_EXISTS)
2293
2354
  */
2294
- async handleLoginFlow(credentials) {
2355
+ async handleLoginFlow(credentials, mode = "CHECK_EMAIL_EXISTS" /* CHECK_EMAIL_EXISTS */) {
2295
2356
  try {
2296
- const emailCheck = await this.authService.checkEmailExists(credentials.email);
2357
+ const strategyResolver = new LoginStrategyResolver(this.authService);
2358
+ const nextAction = await strategyResolver.resolve(credentials.email, mode);
2297
2359
  const strategy = LoginFlowStrategyFactory.createStrategy(
2298
- emailCheck.next_action,
2360
+ nextAction,
2299
2361
  this.authService,
2300
2362
  this.tokenManager
2301
2363
  );
@@ -2982,7 +3044,7 @@ function AuthFlowContainer({
2982
3044
  {
2983
3045
  onSuccess: (data) => {
2984
3046
  setAuthData(data);
2985
- handlePasswordSubmit(password);
3047
+ handlePasswordSubmitAfterVerification(password);
2986
3048
  setPassword("");
2987
3049
  },
2988
3050
  onError: (error) => {
@@ -2991,6 +3053,23 @@ function AuthFlowContainer({
2991
3053
  }
2992
3054
  );
2993
3055
  };
3056
+ const handlePasswordSubmitAfterVerification = async (passwordValue) => {
3057
+ await executeAction(
3058
+ async () => {
3059
+ const loginRequest = { email, password: passwordValue };
3060
+ return await authOrchestrator.handleLoginFlow(loginRequest, "SKIP_EMAIL_CHECK" /* SKIP_EMAIL_CHECK */);
3061
+ },
3062
+ {
3063
+ onSuccess: (data) => {
3064
+ setAuthData(data);
3065
+ handleSuccess();
3066
+ },
3067
+ onError: (error) => {
3068
+ console.error(error);
3069
+ }
3070
+ }
3071
+ );
3072
+ };
2994
3073
  const handleGoogleSignIn = async (token) => {
2995
3074
  await executeAction(
2996
3075
  async () => {
@@ -3528,7 +3607,10 @@ var getForgotPasswordField = (options = {}) => ({
3528
3607
 
3529
3608
 
3530
3609
 
3531
- exports.AUTH_ENDPOINTS = AUTH_ENDPOINTS; exports.AlertDisplay = AlertDisplay; exports.AuthEventType = AuthEventType; exports.AuthFlowContainer = AuthFlowContainer; exports.AuthFlowModal = AuthFlowModal; exports.AuthFlowStep = AuthFlowStep; exports.AuthFlowVariant = AuthFlowVariant; 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.EmailStep = EmailStep; exports.EndpointBuilder = EndpointBuilder; exports.ExistingUserLoginStrategy = ExistingUserLoginStrategy; exports.FormFields = FormFields; exports.FormHeader = FormHeader; exports.GenericErrorHandler = GenericErrorHandler; exports.HttpClient = HttpClient; exports.HttpMethod = HttpMethod; exports.LocalStorageUtils = LocalStorageUtils; exports.LoggerFactory = LoggerFactory; exports.LoginFlowStrategyFactory = LoginFlowStrategyFactory; 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.TokenManager = TokenManager; exports.UnauthenticatedState = UnauthenticatedState; exports.UrlUtils = UrlUtils; exports.UserStorageManager = UserStorageManager; exports.VERIFICATION_SUBMISSION_NAVIGATION = VERIFICATION_SUBMISSION_NAVIGATION; exports.ValidationErrorHandler = ValidationErrorHandler; 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;
3610
+
3611
+
3612
+
3613
+ exports.AUTH_ENDPOINTS = AUTH_ENDPOINTS; exports.AlertDisplay = AlertDisplay; exports.AuthEventType = AuthEventType; exports.AuthFlowContainer = AuthFlowContainer; exports.AuthFlowModal = AuthFlowModal; exports.AuthFlowStep = AuthFlowStep; exports.AuthFlowVariant = AuthFlowVariant; 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.EmailStep = EmailStep; exports.EndpointBuilder = EndpointBuilder; exports.ExistingUserLoginStrategy = ExistingUserLoginStrategy; exports.FormFields = FormFields; exports.FormHeader = FormHeader; exports.GenericErrorHandler = GenericErrorHandler; 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.UrlUtils = UrlUtils; exports.UserStorageManager = UserStorageManager; exports.VERIFICATION_SUBMISSION_NAVIGATION = VERIFICATION_SUBMISSION_NAVIGATION; exports.ValidationErrorHandler = ValidationErrorHandler; 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;
3532
3614
  /*! Bundled license information:
3533
3615
 
3534
3616
  js-cookie/dist/js.cookie.mjs:
package/dist/index.mjs CHANGED
@@ -65,11 +65,11 @@ var AuthFlowStep = /* @__PURE__ */ ((AuthFlowStep2) => {
65
65
  AuthFlowStep2["FORGOT_PASSWORD"] = "forgot-password";
66
66
  return AuthFlowStep2;
67
67
  })(AuthFlowStep || {});
68
- var NextAction = /* @__PURE__ */ ((NextAction2) => {
69
- NextAction2["LOGIN"] = "login";
70
- NextAction2["SIGNUP"] = "signup";
71
- NextAction2["LOGIN_VERIFICATION"] = "login-verification";
72
- return NextAction2;
68
+ var NextAction = /* @__PURE__ */ ((NextAction3) => {
69
+ NextAction3["LOGIN"] = "login";
70
+ NextAction3["SIGNUP"] = "signup";
71
+ NextAction3["LOGIN_VERIFICATION"] = "login-verification";
72
+ return NextAction3;
73
73
  })(NextAction || {});
74
74
 
75
75
  // src/types/auth/auth-types.ts
@@ -2134,6 +2134,21 @@ var ExistingUserLoginStrategy = class {
2134
2134
  }
2135
2135
  };
2136
2136
 
2137
+ // src/services/auth/patterns/strategy/login-verification-strategy.ts
2138
+ var LoginVerificationStrategy = class {
2139
+ constructor(authService, tokenManager) {
2140
+ this.authService = authService;
2141
+ this.tokenManager = tokenManager;
2142
+ }
2143
+ async execute(credentials) {
2144
+ const loginResult = await this.authService.login(credentials);
2145
+ return AuthResultFactory.createSuccess(__spreadProps(__spreadValues({}, loginResult.data), {
2146
+ verification_required: true,
2147
+ message: "Please verify your email to continue"
2148
+ }));
2149
+ }
2150
+ };
2151
+
2137
2152
  // src/services/auth/patterns/strategy/login-flow-strategy-factory.ts
2138
2153
  var LoginFlowStrategyFactory = class {
2139
2154
  static createStrategy(action, authService, tokenManager) {
@@ -2146,9 +2161,53 @@ var LoginFlowStrategyFactory = class {
2146
2161
  };
2147
2162
  LoginFlowStrategyFactory.strategies = /* @__PURE__ */ new Map([
2148
2163
  ["signup" /* SIGNUP */, (authService, tokenManager) => new SignupFlowStrategy(authService, tokenManager)],
2149
- ["login" /* LOGIN */, (authService, tokenManager) => new ExistingUserLoginStrategy(authService, tokenManager)]
2164
+ ["login" /* LOGIN */, (authService, tokenManager) => new ExistingUserLoginStrategy(authService, tokenManager)],
2165
+ ["login-verification" /* LOGIN_VERIFICATION */, (authService, tokenManager) => new LoginVerificationStrategy(authService, tokenManager)]
2150
2166
  ]);
2151
2167
 
2168
+ // src/services/auth/patterns/strategy/login-strategy-resolver.ts
2169
+ var StrategyResolutionMode = /* @__PURE__ */ ((StrategyResolutionMode2) => {
2170
+ StrategyResolutionMode2["SKIP_EMAIL_CHECK"] = "SKIP_EMAIL_CHECK";
2171
+ StrategyResolutionMode2["CHECK_EMAIL_EXISTS"] = "CHECK_EMAIL_EXISTS";
2172
+ return StrategyResolutionMode2;
2173
+ })(StrategyResolutionMode || {});
2174
+ var SkipEmailCheckCommand = class {
2175
+ async execute(_email) {
2176
+ return "login" /* LOGIN */;
2177
+ }
2178
+ };
2179
+ var CheckEmailExistsCommand = class {
2180
+ constructor(authService) {
2181
+ this.authService = authService;
2182
+ }
2183
+ async execute(email) {
2184
+ const emailCheck = await this.authService.checkEmailExists(email);
2185
+ return emailCheck.next_action;
2186
+ }
2187
+ };
2188
+ var LoginStrategyResolver = class {
2189
+ constructor(authService) {
2190
+ this.strategies = /* @__PURE__ */ new Map([
2191
+ ["SKIP_EMAIL_CHECK" /* SKIP_EMAIL_CHECK */, new SkipEmailCheckCommand()],
2192
+ ["CHECK_EMAIL_EXISTS" /* CHECK_EMAIL_EXISTS */, new CheckEmailExistsCommand(authService)]
2193
+ ]);
2194
+ }
2195
+ async resolve(email, mode) {
2196
+ const command = this.strategies.get(mode);
2197
+ if (!command) {
2198
+ throw new Error(`No strategy found for mode: ${mode}`);
2199
+ }
2200
+ return await command.execute(email);
2201
+ }
2202
+ /**
2203
+ * Extend resolver with new strategies at runtime
2204
+ * Example: resolver.registerStrategy(StrategyResolutionMode.CUSTOM, customCommand)
2205
+ */
2206
+ registerStrategy(mode, command) {
2207
+ this.strategies.set(mode, command);
2208
+ }
2209
+ };
2210
+
2152
2211
  // src/services/auth/patterns/state/authenticated-state.ts
2153
2212
  var AuthenticatedState = class {
2154
2213
  async getStatus(tokenManager) {
@@ -2290,12 +2349,15 @@ var AuthOrchestrator = class {
2290
2349
  }
2291
2350
  /**
2292
2351
  * Handle complete login flow with proper error handling and token management
2352
+ * @param credentials - Login credentials (email and password)
2353
+ * @param mode - Strategy resolution mode (defaults to CHECK_EMAIL_EXISTS)
2293
2354
  */
2294
- async handleLoginFlow(credentials) {
2355
+ async handleLoginFlow(credentials, mode = "CHECK_EMAIL_EXISTS" /* CHECK_EMAIL_EXISTS */) {
2295
2356
  try {
2296
- const emailCheck = await this.authService.checkEmailExists(credentials.email);
2357
+ const strategyResolver = new LoginStrategyResolver(this.authService);
2358
+ const nextAction = await strategyResolver.resolve(credentials.email, mode);
2297
2359
  const strategy = LoginFlowStrategyFactory.createStrategy(
2298
- emailCheck.next_action,
2360
+ nextAction,
2299
2361
  this.authService,
2300
2362
  this.tokenManager
2301
2363
  );
@@ -2982,7 +3044,7 @@ function AuthFlowContainer({
2982
3044
  {
2983
3045
  onSuccess: (data) => {
2984
3046
  setAuthData(data);
2985
- handlePasswordSubmit(password);
3047
+ handlePasswordSubmitAfterVerification(password);
2986
3048
  setPassword("");
2987
3049
  },
2988
3050
  onError: (error) => {
@@ -2991,6 +3053,23 @@ function AuthFlowContainer({
2991
3053
  }
2992
3054
  );
2993
3055
  };
3056
+ const handlePasswordSubmitAfterVerification = async (passwordValue) => {
3057
+ await executeAction(
3058
+ async () => {
3059
+ const loginRequest = { email, password: passwordValue };
3060
+ return await authOrchestrator.handleLoginFlow(loginRequest, "SKIP_EMAIL_CHECK" /* SKIP_EMAIL_CHECK */);
3061
+ },
3062
+ {
3063
+ onSuccess: (data) => {
3064
+ setAuthData(data);
3065
+ handleSuccess();
3066
+ },
3067
+ onError: (error) => {
3068
+ console.error(error);
3069
+ }
3070
+ }
3071
+ );
3072
+ };
2994
3073
  const handleGoogleSignIn = async (token) => {
2995
3074
  await executeAction(
2996
3075
  async () => {
@@ -3467,6 +3546,8 @@ export {
3467
3546
  LocalStorageUtils,
3468
3547
  LoggerFactory,
3469
3548
  LoginFlowStrategyFactory,
3549
+ LoginStrategyResolver,
3550
+ LoginVerificationStrategy,
3470
3551
  MiddlewareConfig,
3471
3552
  NavigationAction,
3472
3553
  NetworkErrorHandler,
@@ -3481,6 +3562,7 @@ export {
3481
3562
  ProfileUIState,
3482
3563
  RoleType,
3483
3564
  SignupFlowStrategy,
3565
+ StrategyResolutionMode,
3484
3566
  TokenManager,
3485
3567
  UnauthenticatedState,
3486
3568
  UrlUtils,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailsentry-auth",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Next.js 15 authentication package with multi-step auth flow, cross-tab sync, and Zustand state management",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",