@bymax-one/nest-auth 1.4.4 → 1.4.6

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.
@@ -7,7 +7,6 @@ var AuthContext = createContext(null);
7
7
 
8
8
  // src/react/AuthProvider.tsx
9
9
  var DEFAULT_REVALIDATE_INTERVAL_MS = 3e5;
10
- var DEFAULT_TENANT_ID = "default";
11
10
  var INITIAL_STATE = {
12
11
  user: null,
13
12
  status: "loading",
@@ -132,7 +131,6 @@ function AuthProvider({ children, client, onSessionExpired, revalidateInterval =
132
131
  revalidateInterval
133
132
  ]);
134
133
  const login = useCallback(async (email, password, options) => {
135
- const tenantId = options?.tenantId ?? DEFAULT_TENANT_ID;
136
134
  syncedDispatch({
137
135
  type: "SET_LOADING"
138
136
  });
@@ -140,7 +138,9 @@ function AuthProvider({ children, client, onSessionExpired, revalidateInterval =
140
138
  const result = await clientRef.current.login({
141
139
  email,
142
140
  password,
143
- tenantId
141
+ ...options?.tenantId !== void 0 ? {
142
+ tenantId: options.tenantId
143
+ } : {}
144
144
  });
145
145
  if ("mfaRequired" in result) {
146
146
  sessionGenerationRef.current = {};
@@ -210,7 +210,7 @@ function AuthProvider({ children, client, onSessionExpired, revalidateInterval =
210
210
  ]);
211
211
  const forgotPassword = useCallback(
212
212
  async (email, tenantId) => {
213
- await clientRef.current.forgotPassword(email, tenantId ?? DEFAULT_TENANT_ID);
213
+ await clientRef.current.forgotPassword(email, tenantId);
214
214
  },
215
215
  // Stryker disable next-line ArrayDeclaration: empty deps array with only stable references in scope; a constant-string array re-runs identically
216
216
  []