@greatapps/common 1.1.135 → 1.1.137
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/{account-management.action-7QQCACDJ.mjs → account-management.action-GPQUKGJ4.mjs} +3 -3
- package/dist/{chunk-EC3T7NF6.mjs → chunk-2FMTHF5Y.mjs} +2 -2
- package/dist/chunk-47SDUOY2.mjs +75 -0
- package/dist/chunk-47SDUOY2.mjs.map +1 -0
- package/dist/{chunk-ICUZDG2N.mjs → chunk-4KASY4B6.mjs} +4 -4
- package/dist/{chunk-7MBVHKTC.mjs → chunk-5MR4OYS4.mjs} +1 -1
- package/dist/{chunk-QEFMNBSY.mjs → chunk-5QQ2B7R6.mjs} +4 -4
- package/dist/index.mjs +16 -80
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.mjs +13 -0
- package/dist/server.mjs +11 -11
- package/dist/{validate-session.action-K7RWN2GE.mjs → validate-session.action-QC2VBJ4N.mjs} +3 -3
- package/dist/validate-session.action-QC2VBJ4N.mjs.map +1 -0
- package/dist/{verify-two-factor.action-V6JQATK2.mjs → verify-two-factor.action-BAKUOXIH.mjs} +3 -3
- package/package.json +5 -1
- package/src/middleware.ts +4 -0
- /package/dist/{account-management.action-7QQCACDJ.mjs.map → account-management.action-GPQUKGJ4.mjs.map} +0 -0
- /package/dist/{chunk-EC3T7NF6.mjs.map → chunk-2FMTHF5Y.mjs.map} +0 -0
- /package/dist/{chunk-ICUZDG2N.mjs.map → chunk-4KASY4B6.mjs.map} +0 -0
- /package/dist/{chunk-7MBVHKTC.mjs.map → chunk-5MR4OYS4.mjs.map} +0 -0
- /package/dist/{chunk-QEFMNBSY.mjs.map → chunk-5QQ2B7R6.mjs.map} +0 -0
- /package/dist/{validate-session.action-K7RWN2GE.mjs.map → middleware.mjs.map} +0 -0
- /package/dist/{verify-two-factor.action-V6JQATK2.mjs.map → verify-two-factor.action-BAKUOXIH.mjs.map} +0 -0
package/dist/{account-management.action-7QQCACDJ.mjs → account-management.action-GPQUKGJ4.mjs}
RENAMED
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
updateAccountAction,
|
|
16
16
|
updateAccountUserByIdAction,
|
|
17
17
|
updateUserAction
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-JW4XRHLX.mjs";
|
|
18
|
+
} from "./chunk-5QQ2B7R6.mjs";
|
|
20
19
|
import "./chunk-Z3Q2LLBS.mjs";
|
|
21
20
|
import "./chunk-RV7ECGIH.mjs";
|
|
21
|
+
import "./chunk-JW4XRHLX.mjs";
|
|
22
22
|
import "./chunk-UEWT6VFS.mjs";
|
|
23
23
|
export {
|
|
24
24
|
changePasswordAction,
|
|
@@ -37,4 +37,4 @@ export {
|
|
|
37
37
|
updateAccountUserByIdAction,
|
|
38
38
|
updateUserAction
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=account-management.action-
|
|
40
|
+
//# sourceMappingURL=account-management.action-GPQUKGJ4.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
authService,
|
|
3
3
|
getClientInfoFromRequest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5MR4OYS4.mjs";
|
|
5
5
|
|
|
6
6
|
// src/modules/auth/actions/validate-session.action.ts
|
|
7
7
|
import { redirect } from "next/navigation";
|
|
@@ -47,4 +47,4 @@ async function validateSessionAction() {
|
|
|
47
47
|
export {
|
|
48
48
|
validateSessionAction
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-2FMTHF5Y.mjs.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/middlewares/types.ts
|
|
2
|
+
function continueChain(request) {
|
|
3
|
+
return { type: "next", request };
|
|
4
|
+
}
|
|
5
|
+
function stopChain(response) {
|
|
6
|
+
return { type: "response", response };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/middlewares/create-auth-middleware.ts
|
|
10
|
+
import { NextResponse } from "next/server";
|
|
11
|
+
function isRouteEquals(pathname, routes) {
|
|
12
|
+
return routes.some((route) => pathname === route || pathname.startsWith(`${route}/`));
|
|
13
|
+
}
|
|
14
|
+
function createAuthMiddleware(options) {
|
|
15
|
+
return (request) => {
|
|
16
|
+
const { pathname } = request.nextUrl;
|
|
17
|
+
const token = process.env.DUMMY_AUTH_TOKEN || request.cookies.get("greatapps")?.value;
|
|
18
|
+
const isPublicRoute = isRouteEquals(pathname, options?.publicRoutes || []);
|
|
19
|
+
const isAuthRoute = isRouteEquals(pathname, options?.authRoutes || []);
|
|
20
|
+
if (token && isAuthRoute) {
|
|
21
|
+
return stopChain(NextResponse.redirect(new URL("/", request.url)));
|
|
22
|
+
}
|
|
23
|
+
if (!token && !isPublicRoute && !isAuthRoute) {
|
|
24
|
+
const loginUrl = new URL("/login", request.url);
|
|
25
|
+
if (pathname !== "/") {
|
|
26
|
+
loginUrl.searchParams.set("redirect", pathname);
|
|
27
|
+
}
|
|
28
|
+
return stopChain(NextResponse.redirect(loginUrl));
|
|
29
|
+
}
|
|
30
|
+
return continueChain();
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/middlewares/chain.ts
|
|
35
|
+
import { NextResponse as NextResponse2 } from "next/server";
|
|
36
|
+
function shouldProcessPath(pathname, config) {
|
|
37
|
+
const { excludePaths, includePaths } = config;
|
|
38
|
+
if (excludePaths?.length) {
|
|
39
|
+
const isExcluded = excludePaths.some(
|
|
40
|
+
(path) => pathname === path || pathname.startsWith(`${path}/`)
|
|
41
|
+
);
|
|
42
|
+
if (isExcluded) return false;
|
|
43
|
+
}
|
|
44
|
+
if (includePaths?.length) {
|
|
45
|
+
return includePaths.some((path) => pathname === path || pathname.startsWith(`${path}/`));
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
function createMiddlewareChain(middlewares) {
|
|
50
|
+
return async function chainedMiddleware(request) {
|
|
51
|
+
const { pathname } = request.nextUrl;
|
|
52
|
+
let currentRequest = request;
|
|
53
|
+
for (const middleware of middlewares) {
|
|
54
|
+
if (!shouldProcessPath(pathname, middleware)) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const result = await middleware.handler(currentRequest);
|
|
58
|
+
if (result.type === "response") {
|
|
59
|
+
return result.response;
|
|
60
|
+
}
|
|
61
|
+
if (result.request) {
|
|
62
|
+
currentRequest = result.request;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return NextResponse2.next();
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
continueChain,
|
|
71
|
+
stopChain,
|
|
72
|
+
createAuthMiddleware,
|
|
73
|
+
createMiddlewareChain
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=chunk-47SDUOY2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/middlewares/types.ts","../src/middlewares/create-auth-middleware.ts","../src/middlewares/chain.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\r\n\r\nexport type MiddlewareResult =\r\n | { type: 'response'; response: NextResponse }\r\n | { type: 'next'; request?: NextRequest };\r\n\r\nexport type MiddlewareFunction = (\r\n request: NextRequest\r\n) => MiddlewareResult | Promise<MiddlewareResult>;\r\n\r\nexport interface MiddlewareConfig {\r\n name: string;\r\n handler: MiddlewareFunction;\r\n excludePaths?: string[];\r\n includePaths?: string[];\r\n}\r\n\r\nexport function continueChain(request?: NextRequest): MiddlewareResult {\r\n return { type: 'next', request };\r\n}\r\n\r\nexport function stopChain(response: NextResponse): MiddlewareResult {\r\n return { type: 'response', response };\r\n}\r\n","import { NextRequest, NextResponse } from 'next/server';\r\n\r\nimport { continueChain, MiddlewareConfig, MiddlewareFunction, MiddlewareResult, stopChain } from './types';\r\n\r\nfunction isRouteEquals(pathname: string, routes: string[]): boolean {\r\n return routes.some((route) => pathname === route || pathname.startsWith(`${route}/`));\r\n}\r\n\r\ninterface CreateAuthMiddlewareOptions {\r\n publicRoutes?: string[];\r\n authRoutes?: string[];\r\n}\r\n\r\nexport function createAuthMiddleware(options?: CreateAuthMiddlewareOptions): MiddlewareFunction {\r\n return (request: NextRequest) => {\r\n const { pathname } = request.nextUrl;\r\n const token = process.env.DUMMY_AUTH_TOKEN || request.cookies.get('greatapps')?.value;\r\n const isPublicRoute = isRouteEquals(pathname, options?.publicRoutes || []);\r\n const isAuthRoute = isRouteEquals(pathname, options?.authRoutes || []);\r\n\r\n if (token && isAuthRoute) {\r\n return stopChain(NextResponse.redirect(new URL('/', request.url)));\r\n }\r\n\r\n if (!token && !isPublicRoute && !isAuthRoute) {\r\n const loginUrl = new URL('/login', request.url);\r\n\r\n if (pathname !== '/') {\r\n loginUrl.searchParams.set('redirect', pathname);\r\n }\r\n\r\n return stopChain(NextResponse.redirect(loginUrl));\r\n }\r\n\r\n return continueChain();\r\n }\r\n}","import { NextRequest, NextResponse } from 'next/server';\r\n\r\nimport { MiddlewareConfig } from './types';\r\n\r\nfunction shouldProcessPath(pathname: string, config: MiddlewareConfig): boolean {\r\n const { excludePaths, includePaths } = config;\r\n\r\n if (excludePaths?.length) {\r\n const isExcluded = excludePaths.some(\r\n (path) => pathname === path || pathname.startsWith(`${path}/`)\r\n );\r\n if (isExcluded) return false;\r\n }\r\n\r\n if (includePaths?.length) {\r\n return includePaths.some((path) => pathname === path || pathname.startsWith(`${path}/`));\r\n }\r\n\r\n return true;\r\n}\r\n\r\nexport function createMiddlewareChain(middlewares: MiddlewareConfig[]) {\r\n return async function chainedMiddleware(request: NextRequest): Promise<NextResponse> {\r\n const { pathname } = request.nextUrl;\r\n let currentRequest = request;\r\n\r\n for (const middleware of middlewares) {\r\n if (!shouldProcessPath(pathname, middleware)) {\r\n continue;\r\n }\r\n\r\n const result = await middleware.handler(currentRequest);\r\n\r\n if (result.type === 'response') {\r\n return result.response;\r\n }\r\n\r\n if (result.request) {\r\n currentRequest = result.request;\r\n }\r\n }\r\n\r\n return NextResponse.next();\r\n };\r\n}\r\n"],"mappings":";AAiBO,SAAS,cAAc,SAAyC;AACrE,SAAO,EAAE,MAAM,QAAQ,QAAQ;AACjC;AAEO,SAAS,UAAU,UAA0C;AAClE,SAAO,EAAE,MAAM,YAAY,SAAS;AACtC;;;ACvBA,SAAsB,oBAAoB;AAI1C,SAAS,cAAc,UAAkB,QAA2B;AAClE,SAAO,OAAO,KAAK,CAAC,UAAU,aAAa,SAAS,SAAS,WAAW,GAAG,KAAK,GAAG,CAAC;AACtF;AAOO,SAAS,qBAAqB,SAA2D;AAC9F,SAAO,CAAC,YAAyB;AAC/B,UAAM,EAAE,SAAS,IAAI,QAAQ;AAC7B,UAAM,QAAQ,QAAQ,IAAI,oBAAoB,QAAQ,QAAQ,IAAI,WAAW,GAAG;AAChF,UAAM,gBAAgB,cAAc,UAAU,SAAS,gBAAgB,CAAC,CAAC;AACzE,UAAM,cAAc,cAAc,UAAU,SAAS,cAAc,CAAC,CAAC;AAErE,QAAI,SAAS,aAAa;AACxB,aAAO,UAAU,aAAa,SAAS,IAAI,IAAI,KAAK,QAAQ,GAAG,CAAC,CAAC;AAAA,IACnE;AAEA,QAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,aAAa;AAC5C,YAAM,WAAW,IAAI,IAAI,UAAU,QAAQ,GAAG;AAE9C,UAAI,aAAa,KAAK;AACpB,iBAAS,aAAa,IAAI,YAAY,QAAQ;AAAA,MAChD;AAEA,aAAO,UAAU,aAAa,SAAS,QAAQ,CAAC;AAAA,IAClD;AAEA,WAAO,cAAc;AAAA,EACvB;AACF;;;ACpCA,SAAsB,gBAAAA,qBAAoB;AAI1C,SAAS,kBAAkB,UAAkB,QAAmC;AAC9E,QAAM,EAAE,cAAc,aAAa,IAAI;AAEvC,MAAI,cAAc,QAAQ;AACxB,UAAM,aAAa,aAAa;AAAA,MAC9B,CAAC,SAAS,aAAa,QAAQ,SAAS,WAAW,GAAG,IAAI,GAAG;AAAA,IAC/D;AACA,QAAI,WAAY,QAAO;AAAA,EACzB;AAEA,MAAI,cAAc,QAAQ;AACxB,WAAO,aAAa,KAAK,CAAC,SAAS,aAAa,QAAQ,SAAS,WAAW,GAAG,IAAI,GAAG,CAAC;AAAA,EACzF;AAEA,SAAO;AACT;AAEO,SAAS,sBAAsB,aAAiC;AACrE,SAAO,eAAe,kBAAkB,SAA6C;AACnF,UAAM,EAAE,SAAS,IAAI,QAAQ;AAC7B,QAAI,iBAAiB;AAErB,eAAW,cAAc,aAAa;AACpC,UAAI,CAAC,kBAAkB,UAAU,UAAU,GAAG;AAC5C;AAAA,MACF;AAEA,YAAM,SAAS,MAAM,WAAW,QAAQ,cAAc;AAEtD,UAAI,OAAO,SAAS,YAAY;AAC9B,eAAO,OAAO;AAAA,MAChB;AAEA,UAAI,OAAO,SAAS;AAClB,yBAAiB,OAAO;AAAA,MAC1B;AAAA,IACF;AAEA,WAAOA,cAAa,KAAK;AAAA,EAC3B;AACF;","names":["NextResponse"]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
safeServerAction
|
|
3
|
-
} from "./chunk-JW4XRHLX.mjs";
|
|
4
1
|
import {
|
|
5
2
|
accountService,
|
|
6
3
|
buildQueryParams,
|
|
@@ -9,6 +6,9 @@ import {
|
|
|
9
6
|
import {
|
|
10
7
|
api
|
|
11
8
|
} from "./chunk-RV7ECGIH.mjs";
|
|
9
|
+
import {
|
|
10
|
+
safeServerAction
|
|
11
|
+
} from "./chunk-JW4XRHLX.mjs";
|
|
12
12
|
import {
|
|
13
13
|
ApiError
|
|
14
14
|
} from "./chunk-UEWT6VFS.mjs";
|
|
@@ -280,4 +280,4 @@ export {
|
|
|
280
280
|
addProjectUserAction,
|
|
281
281
|
removeProjectUserAction
|
|
282
282
|
};
|
|
283
|
-
//# sourceMappingURL=chunk-
|
|
283
|
+
//# sourceMappingURL=chunk-4KASY4B6.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
safeServerAction
|
|
3
|
-
} from "./chunk-JW4XRHLX.mjs";
|
|
4
1
|
import {
|
|
5
2
|
accountService,
|
|
6
3
|
getUserContext
|
|
7
4
|
} from "./chunk-Z3Q2LLBS.mjs";
|
|
5
|
+
import {
|
|
6
|
+
safeServerAction
|
|
7
|
+
} from "./chunk-JW4XRHLX.mjs";
|
|
8
8
|
import {
|
|
9
9
|
ApiError,
|
|
10
10
|
findWhitelabel
|
|
@@ -162,4 +162,4 @@ export {
|
|
|
162
162
|
confirmTwoFactorAction,
|
|
163
163
|
disableTwoFactorAction
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-5QQ2B7R6.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
continueChain,
|
|
3
|
+
createAuthMiddleware,
|
|
4
|
+
createMiddlewareChain,
|
|
5
|
+
stopChain
|
|
6
|
+
} from "./chunk-47SDUOY2.mjs";
|
|
1
7
|
import {
|
|
2
8
|
SubscriptionItemSchema,
|
|
3
9
|
SubscriptionSchema,
|
|
@@ -8,11 +14,11 @@ import {
|
|
|
8
14
|
listProjectUsersAction,
|
|
9
15
|
listSubscriptionsAction,
|
|
10
16
|
removeProjectUserAction
|
|
11
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4KASY4B6.mjs";
|
|
12
18
|
import {
|
|
13
19
|
authService,
|
|
14
20
|
getClientInfoFromRequest
|
|
15
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5MR4OYS4.mjs";
|
|
16
22
|
import {
|
|
17
23
|
changePasswordAction,
|
|
18
24
|
confirmEmailChangeAction,
|
|
@@ -27,10 +33,7 @@ import {
|
|
|
27
33
|
updateAccountAction,
|
|
28
34
|
updateAccountUserByIdAction,
|
|
29
35
|
updateUserAction
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
safeServerAction
|
|
33
|
-
} from "./chunk-JW4XRHLX.mjs";
|
|
36
|
+
} from "./chunk-5QQ2B7R6.mjs";
|
|
34
37
|
import {
|
|
35
38
|
buildQueryParams,
|
|
36
39
|
getUserContext
|
|
@@ -38,6 +41,9 @@ import {
|
|
|
38
41
|
import {
|
|
39
42
|
api
|
|
40
43
|
} from "./chunk-RV7ECGIH.mjs";
|
|
44
|
+
import {
|
|
45
|
+
safeServerAction
|
|
46
|
+
} from "./chunk-JW4XRHLX.mjs";
|
|
41
47
|
import {
|
|
42
48
|
ApiError,
|
|
43
49
|
PaginationParamsSchema,
|
|
@@ -180,7 +186,7 @@ async function fetchUser() {
|
|
|
180
186
|
return result.success && result.data ? result.data : null;
|
|
181
187
|
}
|
|
182
188
|
async function validateUserSession() {
|
|
183
|
-
const { validateSessionAction } = await import("./validate-session.action-
|
|
189
|
+
const { validateSessionAction } = await import("./validate-session.action-QC2VBJ4N.mjs");
|
|
184
190
|
return await validateSessionAction();
|
|
185
191
|
}
|
|
186
192
|
function useUserQuery() {
|
|
@@ -207,7 +213,7 @@ function useTwoFactorVerify() {
|
|
|
207
213
|
const queryClient = useQueryClient();
|
|
208
214
|
return useMutation({
|
|
209
215
|
mutationFn: async ({ cookie, code }) => {
|
|
210
|
-
const { verifyTwoFactorAction } = await import("./verify-two-factor.action-
|
|
216
|
+
const { verifyTwoFactorAction } = await import("./verify-two-factor.action-BAKUOXIH.mjs");
|
|
211
217
|
return withAction(() => verifyTwoFactorAction(cookie, code))();
|
|
212
218
|
},
|
|
213
219
|
onSuccess: () => {
|
|
@@ -576,76 +582,6 @@ var ADDON_IDS = {
|
|
|
576
582
|
AI: 6
|
|
577
583
|
};
|
|
578
584
|
|
|
579
|
-
// src/middlewares/create-auth-middleware.ts
|
|
580
|
-
import { NextResponse } from "next/server";
|
|
581
|
-
|
|
582
|
-
// src/middlewares/types.ts
|
|
583
|
-
function continueChain(request) {
|
|
584
|
-
return { type: "next", request };
|
|
585
|
-
}
|
|
586
|
-
function stopChain(response) {
|
|
587
|
-
return { type: "response", response };
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// src/middlewares/create-auth-middleware.ts
|
|
591
|
-
function isRouteEquals(pathname, routes) {
|
|
592
|
-
return routes.some((route) => pathname === route || pathname.startsWith(`${route}/`));
|
|
593
|
-
}
|
|
594
|
-
function createAuthMiddleware(options) {
|
|
595
|
-
return (request) => {
|
|
596
|
-
const { pathname } = request.nextUrl;
|
|
597
|
-
const token = process.env.DUMMY_AUTH_TOKEN || request.cookies.get("greatapps")?.value;
|
|
598
|
-
const isPublicRoute = isRouteEquals(pathname, options?.publicRoutes || []);
|
|
599
|
-
const isAuthRoute = isRouteEquals(pathname, options?.authRoutes || []);
|
|
600
|
-
if (token && isAuthRoute) {
|
|
601
|
-
return stopChain(NextResponse.redirect(new URL("/", request.url)));
|
|
602
|
-
}
|
|
603
|
-
if (!token && !isPublicRoute && !isAuthRoute) {
|
|
604
|
-
const loginUrl = new URL("/login", request.url);
|
|
605
|
-
if (pathname !== "/") {
|
|
606
|
-
loginUrl.searchParams.set("redirect", pathname);
|
|
607
|
-
}
|
|
608
|
-
return stopChain(NextResponse.redirect(loginUrl));
|
|
609
|
-
}
|
|
610
|
-
return continueChain();
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
// src/middlewares/chain.ts
|
|
615
|
-
import { NextResponse as NextResponse2 } from "next/server";
|
|
616
|
-
function shouldProcessPath(pathname, config) {
|
|
617
|
-
const { excludePaths, includePaths } = config;
|
|
618
|
-
if (excludePaths?.length) {
|
|
619
|
-
const isExcluded = excludePaths.some(
|
|
620
|
-
(path) => pathname === path || pathname.startsWith(`${path}/`)
|
|
621
|
-
);
|
|
622
|
-
if (isExcluded) return false;
|
|
623
|
-
}
|
|
624
|
-
if (includePaths?.length) {
|
|
625
|
-
return includePaths.some((path) => pathname === path || pathname.startsWith(`${path}/`));
|
|
626
|
-
}
|
|
627
|
-
return true;
|
|
628
|
-
}
|
|
629
|
-
function createMiddlewareChain(middlewares) {
|
|
630
|
-
return async function chainedMiddleware(request) {
|
|
631
|
-
const { pathname } = request.nextUrl;
|
|
632
|
-
let currentRequest = request;
|
|
633
|
-
for (const middleware of middlewares) {
|
|
634
|
-
if (!shouldProcessPath(pathname, middleware)) {
|
|
635
|
-
continue;
|
|
636
|
-
}
|
|
637
|
-
const result = await middleware.handler(currentRequest);
|
|
638
|
-
if (result.type === "response") {
|
|
639
|
-
return result.response;
|
|
640
|
-
}
|
|
641
|
-
if (result.request) {
|
|
642
|
-
currentRequest = result.request;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
return NextResponse2.next();
|
|
646
|
-
};
|
|
647
|
-
}
|
|
648
|
-
|
|
649
585
|
// src/infra/utils/clsx.ts
|
|
650
586
|
import { clsx } from "clsx";
|
|
651
587
|
import { twMerge } from "tailwind-merge";
|
|
@@ -7601,7 +7537,7 @@ function ChangePhoneModal({ open, onClose }) {
|
|
|
7601
7537
|
return result.success;
|
|
7602
7538
|
},
|
|
7603
7539
|
resendFn: async () => {
|
|
7604
|
-
const { requestPhoneChangeAction: requestPhoneChangeAction2 } = await import("./account-management.action-
|
|
7540
|
+
const { requestPhoneChangeAction: requestPhoneChangeAction2 } = await import("./account-management.action-GPQUKGJ4.mjs");
|
|
7605
7541
|
const result = await requestPhoneChangeAction2(phoneValue);
|
|
7606
7542
|
if (!result.success) {
|
|
7607
7543
|
throw new Error(result.error);
|
|
@@ -7814,7 +7750,7 @@ function ChangeEmailModal({ open, onClose }) {
|
|
|
7814
7750
|
return result.success;
|
|
7815
7751
|
},
|
|
7816
7752
|
resendFn: async () => {
|
|
7817
|
-
const { requestEmailChangeAction: requestEmailChangeAction2 } = await import("./account-management.action-
|
|
7753
|
+
const { requestEmailChangeAction: requestEmailChangeAction2 } = await import("./account-management.action-GPQUKGJ4.mjs");
|
|
7818
7754
|
const result = await requestEmailChangeAction2(emailToVerify);
|
|
7819
7755
|
if (!result.success) {
|
|
7820
7756
|
throw new Error(result.error);
|