@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.
- package/CHANGELOG.md +610 -3
- package/README.md +248 -31
- package/dist/nextjs/index.d.cts +10 -12
- package/dist/nextjs/index.d.ts +10 -12
- package/dist/react/index.cjs +4 -4
- package/dist/react/index.d.cts +15 -2
- package/dist/react/index.d.ts +15 -2
- package/dist/react/index.mjs +4 -4
- package/dist/server/index.cjs +2169 -970
- package/dist/server/index.d.cts +639 -84
- package/dist/server/index.d.ts +639 -84
- package/dist/server/index.mjs +2172 -973
- package/package.json +5 -4
package/dist/react/index.mjs
CHANGED
|
@@ -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
|
|
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
|
[]
|