Auto-commit 2026-04-29 16:31

This commit is contained in:
2026-04-29 16:31:27 -04:00
parent e8687bb6b2
commit 0495ee5bd2
19691 changed files with 3272886 additions and 138 deletions

37
node_modules/next-auth/next/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from "next";
import { type NextRequest } from "next/server";
import type { AuthOptions, Session } from "..";
import type { CallbacksOptions, Awaitable } from "../core/types";
interface RouteHandlerContext {
params: Awaitable<{
nextauth: string[];
}>;
}
declare function NextAuth(options: AuthOptions): any;
declare function NextAuth(req: NextApiRequest, res: NextApiResponse, options: AuthOptions): any;
declare function NextAuth(req: NextRequest, res: RouteHandlerContext, options: AuthOptions): any;
export default NextAuth;
declare type GetServerSessionOptions = Partial<Omit<AuthOptions, "callbacks">> & {
callbacks?: Omit<AuthOptions["callbacks"], "session"> & {
session?: (...args: Parameters<CallbacksOptions["session"]>) => any;
};
};
declare type GetServerSessionParams<O extends GetServerSessionOptions> = [GetServerSidePropsContext["req"], GetServerSidePropsContext["res"], O] | [NextApiRequest, NextApiResponse, O] | [O] | [];
export declare function getServerSession<O extends GetServerSessionOptions, R = O["callbacks"] extends {
session: (...args: any[]) => infer U;
} ? U : Session>(...args: GetServerSessionParams<O>): Promise<R | null>;
/** @deprecated renamed to `getServerSession` */
export declare function unstable_getServerSession<O extends GetServerSessionOptions, R = O["callbacks"] extends {
session: (...args: any[]) => infer U;
} ? U : Session>(...args: GetServerSessionParams<O>): Promise<R | null>;
declare global {
namespace NodeJS {
interface ProcessEnv {
NEXTAUTH_URL?: string;
NEXTAUTH_SECRET?: string;
AUTH_SECRET?: string;
VERCEL?: "1";
}
}
}
//# sourceMappingURL=index.d.ts.map

1
node_modules/next-auth/next/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/next/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,eAAe,EAChB,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAC9C,OAAO,KAAK,EACV,gBAAgB,EAIhB,SAAS,EACV,MAAM,eAAe,CAAA;AAEtB,UAAU,mBAAmB;IAC3B,MAAM,EAAE,SAAS,CAAC;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAC1C;AA6FD,iBAAS,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,GAAG,CAAA;AAC5C,iBAAS,QAAQ,CACf,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,WAAW,GACnB,GAAG,CAAA;AAEN,iBAAS,QAAQ,CACf,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,mBAAmB,EACxB,OAAO,EAAE,WAAW,GACnB,GAAG,CAAA;AAsCN,eAAe,QAAQ,CAAA;AAEvB,aAAK,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,GAAG;IACvE,SAAS,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,GAAG;QACtD,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,KAAK,GAAG,CAAA;KACpE,CAAA;CACF,CAAA;AAED,aAAK,sBAAsB,CAAC,CAAC,SAAS,uBAAuB,IACzD,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAE,yBAAyB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GACvE,CAAC,cAAc,EAAE,eAAe,EAAE,CAAC,CAAC,GACpC,CAAC,CAAC,CAAC,GACH,EAAE,CAAA;AAEN,wBAAsB,gBAAgB,CACpC,CAAC,SAAS,uBAAuB,EACjC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,SAAS;IAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAA;CAAE,GAC/D,CAAC,GACD,OAAO,EACX,GAAG,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAgDvD;AAID,gDAAgD;AAChD,wBAAsB,yBAAyB,CAC7C,CAAC,SAAS,uBAAuB,EACjC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,SAAS;IAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAA;CAAE,GAC/D,CAAC,GACD,OAAO,EACX,GAAG,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CASvD;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM,CAAC;QACf,UAAU,UAAU;YAClB,YAAY,CAAC,EAAE,MAAM,CAAA;YACrB,eAAe,CAAC,EAAE,MAAM,CAAA;YACxB,WAAW,CAAC,EAAE,MAAM,CAAA;YACpB,MAAM,CAAC,EAAE,GAAG,CAAA;SACb;KACF;CACF"}

160
node_modules/next-auth/next/index.js generated vendored Normal file
View File

@@ -0,0 +1,160 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.getServerSession = getServerSession;
exports.unstable_getServerSession = unstable_getServerSession;
var _core = require("../core");
var _utils = require("./utils");
async function NextAuthApiHandler(req, res, options) {
var _options$secret, _ref, _options$jwt$secret, _options$jwt, _ref2, _handler$status, _handler$cookies, _handler$headers;
const {
nextauth,
...query
} = req.query;
(_options$secret = options.secret) !== null && _options$secret !== void 0 ? _options$secret : options.secret = (_ref = (_options$jwt$secret = (_options$jwt = options.jwt) === null || _options$jwt === void 0 ? void 0 : _options$jwt.secret) !== null && _options$jwt$secret !== void 0 ? _options$jwt$secret : process.env.NEXTAUTH_SECRET) !== null && _ref !== void 0 ? _ref : process.env.AUTH_SECRET;
const handler = await (0, _core.AuthHandler)({
req: {
body: req.body,
query,
cookies: req.cookies,
headers: req.headers,
method: req.method,
action: nextauth === null || nextauth === void 0 ? void 0 : nextauth[0],
providerId: nextauth === null || nextauth === void 0 ? void 0 : nextauth[1],
error: (_ref2 = req.query.error) !== null && _ref2 !== void 0 ? _ref2 : nextauth === null || nextauth === void 0 ? void 0 : nextauth[1]
},
options
});
res.status((_handler$status = handler.status) !== null && _handler$status !== void 0 ? _handler$status : 200);
(_handler$cookies = handler.cookies) === null || _handler$cookies === void 0 || _handler$cookies.forEach(cookie => (0, _utils.setCookie)(res, cookie));
(_handler$headers = handler.headers) === null || _handler$headers === void 0 || _handler$headers.forEach(h => res.setHeader(h.key, h.value));
if (handler.redirect) {
var _req$body;
if (((_req$body = req.body) === null || _req$body === void 0 ? void 0 : _req$body.json) !== "true") {
res.status(302).setHeader("Location", handler.redirect);
res.end();
return;
}
return res.json({
url: handler.redirect
});
}
return res.send(handler.body);
}
async function NextAuthRouteHandler(req, context, options) {
var _options$secret2, _process$env$NEXTAUTH, _await$context$params, _query$error;
(_options$secret2 = options.secret) !== null && _options$secret2 !== void 0 ? _options$secret2 : options.secret = (_process$env$NEXTAUTH = process.env.NEXTAUTH_SECRET) !== null && _process$env$NEXTAUTH !== void 0 ? _process$env$NEXTAUTH : process.env.AUTH_SECRET;
const {
headers,
cookies
} = require("next/headers");
const nextauth = (_await$context$params = await context.params) === null || _await$context$params === void 0 ? void 0 : _await$context$params.nextauth;
const query = Object.fromEntries(req.nextUrl.searchParams);
const body = await (0, _utils.getBody)(req);
const internalResponse = await (0, _core.AuthHandler)({
req: {
body,
query,
cookies: Object.fromEntries((await cookies()).getAll().map(c => [c.name, c.value])),
headers: Object.fromEntries(await headers()),
method: req.method,
action: nextauth === null || nextauth === void 0 ? void 0 : nextauth[0],
providerId: nextauth === null || nextauth === void 0 ? void 0 : nextauth[1],
error: (_query$error = query.error) !== null && _query$error !== void 0 ? _query$error : nextauth === null || nextauth === void 0 ? void 0 : nextauth[1]
},
options
});
const response = (0, _utils.toResponse)(internalResponse);
const redirect = response.headers.get("Location");
if ((body === null || body === void 0 ? void 0 : body.json) === "true" && redirect) {
response.headers.delete("Location");
response.headers.set("Content-Type", "application/json");
return new Response(JSON.stringify({
url: redirect
}), {
status: internalResponse.status,
headers: response.headers
});
}
return response;
}
function NextAuth(...args) {
var _args$;
if (args.length === 1) {
return async (req, res) => {
if (res !== null && res !== void 0 && res.params) {
return await NextAuthRouteHandler(req, res, args[0]);
}
return await NextAuthApiHandler(req, res, args[0]);
};
}
if ((_args$ = args[1]) !== null && _args$ !== void 0 && _args$.params) {
return NextAuthRouteHandler(...args);
}
return NextAuthApiHandler(...args);
}
var _default = exports.default = NextAuth;
async function getServerSession(...args) {
var _options, _options$secret3, _process$env$NEXTAUTH2;
const isRSC = args.length === 0 || args.length === 1;
let req, res, options;
if (isRSC) {
options = Object.assign({}, args[0], {
providers: []
});
const {
headers,
cookies
} = require("next/headers");
req = {
headers: Object.fromEntries(await headers()),
cookies: Object.fromEntries((await cookies()).getAll().map(c => [c.name, c.value]))
};
res = {
getHeader() {},
setCookie() {},
setHeader() {}
};
} else {
req = args[0];
res = args[1];
options = Object.assign({}, args[2], {
providers: []
});
}
(_options$secret3 = (_options = options).secret) !== null && _options$secret3 !== void 0 ? _options$secret3 : _options.secret = (_process$env$NEXTAUTH2 = process.env.NEXTAUTH_SECRET) !== null && _process$env$NEXTAUTH2 !== void 0 ? _process$env$NEXTAUTH2 : process.env.AUTH_SECRET;
const session = await (0, _core.AuthHandler)({
options,
req: {
action: "session",
method: "GET",
cookies: req.cookies,
headers: req.headers
}
});
const {
body,
cookies,
status = 200
} = session;
cookies === null || cookies === void 0 || cookies.forEach(cookie => (0, _utils.setCookie)(res, cookie));
if (body && typeof body !== "string" && Object.keys(body).length) {
if (status === 200) {
if (isRSC) delete body.expires;
return body;
}
throw new Error(body.message);
}
return null;
}
let deprecatedWarningShown = false;
async function unstable_getServerSession(...args) {
if (!deprecatedWarningShown && process.env.NODE_ENV !== "production") {
console.warn("`unstable_getServerSession` has been renamed to `getServerSession`.");
deprecatedWarningShown = true;
}
return await getServerSession(...args);
}

110
node_modules/next-auth/next/middleware.d.ts generated vendored Normal file
View File

@@ -0,0 +1,110 @@
import type { NextMiddleware, NextFetchEvent } from "next/server";
import type { Awaitable, CookieOption, AuthOptions } from "..";
import type { JWT, JWTOptions } from "../jwt";
import { NextRequest } from "next/server";
declare type AuthorizedCallback = (params: {
token: JWT | null;
req: NextRequest;
}) => Awaitable<boolean>;
export interface NextAuthMiddlewareOptions {
/**
* Where to redirect the user in case of an error if they weren't logged in.
* Similar to `pages` in `NextAuth`.
*
* ---
* [Documentation](https://next-auth.js.org/configuration/pages)
*/
pages?: AuthOptions["pages"];
/**
* You can override the default cookie names and options for any of the cookies
* by this middleware. Similar to `cookies` in `NextAuth`.
*
* Useful if the token is stored in not a default cookie.
*
* ---
* [Documentation](https://next-auth.js.org/configuration/options#cookies)
*
* - ⚠ **This is an advanced option.** Advanced options are passed the same way as basic options,
* but **may have complex implications** or side effects.
* You should **try to avoid using advanced options** unless you are very comfortable using them.
*
*/
cookies?: Partial<Record<keyof Pick<keyof AuthOptions["cookies"], "sessionToken">, Omit<CookieOption, "options">>>;
/**
* If a custom jwt `decode` method is set in `[...nextauth].ts`, the same method should be set here also.
*
* ---
* [Documentation](https://next-auth.js.org/configuration/nextjs#custom-jwt-decode-method)
*/
jwt?: Partial<Pick<JWTOptions, "decode">>;
callbacks?: {
/**
* Callback that receives the user's JWT payload
* and returns `true` to allow the user to continue.
*
* This is similar to the `signIn` callback in `NextAuthOptions`.
*
* If it returns `false`, the user is redirected to the sign-in page instead
*
* The default is to let the user continue if they have a valid JWT (basic authentication).
*
* How to restrict a page and all of it's subpages for admins-only:
* @example
*
* ```js
* // `middleware.js`
* import { withAuth } from "next-auth/middleware"
*
* export default withAuth({
* callbacks: {
* authorized: ({ token }) => token?.user.isAdmin
* }
* })
*
* export const config = { matcher: ["/admin"] }
*
* ```
*
* ---
* [Documentation](https://next-auth.js.org/configuration/nextjs#middleware) | [`signIn` callback](configuration/callbacks#sign-in-callback)
*/
authorized?: AuthorizedCallback;
};
/**
* The same `secret` used in the `NextAuth` configuration.
* Defaults to the `NEXTAUTH_SECRET` environment variable.
*/
secret?: string;
}
declare type NextMiddlewareResult = ReturnType<NextMiddleware> | void;
export interface NextRequestWithAuth extends NextRequest {
nextauth: {
token: JWT | null;
};
}
export declare type NextMiddlewareWithAuth = (request: NextRequestWithAuth, event: NextFetchEvent) => NextMiddlewareResult | Promise<NextMiddlewareResult>;
export declare type WithAuthArgs = [NextRequestWithAuth] | [NextRequestWithAuth, NextFetchEvent] | [NextRequestWithAuth, NextAuthMiddlewareOptions] | [NextMiddlewareWithAuth] | [NextMiddlewareWithAuth, NextAuthMiddlewareOptions] | [NextAuthMiddlewareOptions] | [];
/**
* Middleware that checks if the user is authenticated/authorized.
* If if they aren't, they will be redirected to the login page.
* Otherwise, continue.
*
* @example
*
* ```js
* // `middleware.js`
* export { default } from "next-auth/middleware"
* ```
*
* ---
* [Documentation](https://next-auth.js.org/configuration/nextjs#middleware)
*/
export declare function withAuth(): ReturnType<NextMiddlewareWithAuth>;
export declare function withAuth(req: NextRequestWithAuth): ReturnType<NextMiddlewareWithAuth>;
export declare function withAuth(req: NextRequestWithAuth, event: NextFetchEvent): ReturnType<NextMiddlewareWithAuth>;
export declare function withAuth(req: NextRequestWithAuth, options: NextAuthMiddlewareOptions): ReturnType<NextMiddlewareWithAuth>;
export declare function withAuth(middleware: NextMiddlewareWithAuth, options: NextAuthMiddlewareOptions): NextMiddlewareWithAuth;
export declare function withAuth(middleware: NextMiddlewareWithAuth): NextMiddlewareWithAuth;
export declare function withAuth(options: NextAuthMiddlewareOptions): NextMiddlewareWithAuth;
export default withAuth;
//# sourceMappingURL=middleware.d.ts.map

1
node_modules/next-auth/next/middleware.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/next/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAA;AAKvD,aAAK,kBAAkB,GAAG,CAAC,MAAM,EAAE;IACjC,KAAK,EAAE,GAAG,GAAG,IAAI,CAAA;IACjB,GAAG,EAAE,WAAW,CAAA;CACjB,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA;AAExB,MAAM,WAAW,yBAAyB;IACxC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAE5B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,OAAO,CACf,MAAM,CACJ,MAAM,IAAI,CAAC,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,EACxD,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAC9B,CACF,CAAA;IAED;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEzC,SAAS,CAAC,EAAE;QACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BG;QACH,UAAU,CAAC,EAAE,kBAAkB,CAAA;KAChC,CAAA;IAED;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID,aAAK,oBAAoB,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,IAAI,CAAA;AA4D7D,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,QAAQ,EAAE;QAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAA;KAAE,CAAA;CAChC;AAED,oBAAY,sBAAsB,GAAG,CACnC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,cAAc,KAClB,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAEzD,oBAAY,YAAY,GACpB,CAAC,mBAAmB,CAAC,GACrB,CAAC,mBAAmB,EAAE,cAAc,CAAC,GACrC,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,GAChD,CAAC,sBAAsB,CAAC,GACxB,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GACnD,CAAC,yBAAyB,CAAC,GAC3B,EAAE,CAAA;AAEN;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,QAAQ,IAAI,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAE9D,wBAAgB,QAAQ,CACtB,GAAG,EAAE,mBAAmB,GACvB,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAErC,wBAAgB,QAAQ,CACtB,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,cAAc,GACpB,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAErC,wBAAgB,QAAQ,CACtB,GAAG,EAAE,mBAAmB,EACxB,OAAO,EAAE,yBAAyB,GACjC,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAErC,wBAAgB,QAAQ,CACtB,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,yBAAyB,GACjC,sBAAsB,CAAA;AAEzB,wBAAgB,QAAQ,CACtB,UAAU,EAAE,sBAAsB,GACjC,sBAAsB,CAAA;AAEzB,wBAAgB,QAAQ,CACtB,OAAO,EAAE,yBAAyB,GACjC,sBAAsB,CAAA;AAyBzB,eAAe,QAAQ,CAAA"}

66
node_modules/next-auth/next/middleware.js generated vendored Normal file
View File

@@ -0,0 +1,66 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.withAuth = withAuth;
var _server = require("next/server");
var _jwt = require("../jwt");
var _parseUrl = _interopRequireDefault(require("../utils/parse-url"));
async function handleMiddleware(req, options, onSuccess) {
var _options$pages$signIn, _options$pages, _options$pages$error, _options$pages2, _ref, _options$secret, _options$jwt, _options$cookies, _await$options$callba, _options$callbacks, _options$callbacks$au;
const {
pathname,
search,
origin,
basePath
} = req.nextUrl;
const signInPage = (_options$pages$signIn = options === null || options === void 0 || (_options$pages = options.pages) === null || _options$pages === void 0 ? void 0 : _options$pages.signIn) !== null && _options$pages$signIn !== void 0 ? _options$pages$signIn : "/api/auth/signin";
const errorPage = (_options$pages$error = options === null || options === void 0 || (_options$pages2 = options.pages) === null || _options$pages2 === void 0 ? void 0 : _options$pages2.error) !== null && _options$pages$error !== void 0 ? _options$pages$error : "/api/auth/error";
const authPath = (0, _parseUrl.default)(process.env.NEXTAUTH_URL).path;
const publicPaths = ["/_next", "/favicon.ico"];
if (`${basePath}${pathname}`.startsWith(authPath) || [signInPage, errorPage].includes(pathname) || publicPaths.some(p => pathname.startsWith(p))) {
return;
}
const secret = (_ref = (_options$secret = options === null || options === void 0 ? void 0 : options.secret) !== null && _options$secret !== void 0 ? _options$secret : process.env.NEXTAUTH_SECRET) !== null && _ref !== void 0 ? _ref : process.env.AUTH_SECRET;
if (!secret) {
console.error(`[next-auth][error][NO_SECRET]`, `\nhttps://next-auth.js.org/errors#no_secret`);
const errorUrl = new URL(`${basePath}${errorPage}`, origin);
errorUrl.searchParams.append("error", "Configuration");
return _server.NextResponse.redirect(errorUrl);
}
const token = await (0, _jwt.getToken)({
req,
decode: options === null || options === void 0 || (_options$jwt = options.jwt) === null || _options$jwt === void 0 ? void 0 : _options$jwt.decode,
cookieName: options === null || options === void 0 || (_options$cookies = options.cookies) === null || _options$cookies === void 0 || (_options$cookies = _options$cookies.sessionToken) === null || _options$cookies === void 0 ? void 0 : _options$cookies.name,
secret
});
const isAuthorized = (_await$options$callba = await (options === null || options === void 0 || (_options$callbacks = options.callbacks) === null || _options$callbacks === void 0 || (_options$callbacks$au = _options$callbacks.authorized) === null || _options$callbacks$au === void 0 ? void 0 : _options$callbacks$au.call(_options$callbacks, {
req,
token
}))) !== null && _await$options$callba !== void 0 ? _await$options$callba : !!token;
if (isAuthorized) return await (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(token));
const signInUrl = new URL(`${basePath}${signInPage}`, origin);
signInUrl.searchParams.append("callbackUrl", `${basePath}${pathname}${search}`);
return _server.NextResponse.redirect(signInUrl);
}
function withAuth(...args) {
if (!args.length || args[0] instanceof Request) {
return handleMiddleware(...args);
}
if (typeof args[0] === "function") {
const middleware = args[0];
const options = args[1];
return async (...args) => await handleMiddleware(args[0], options, async token => {
args[0].nextauth = {
token
};
return await middleware(...args);
});
}
const options = args[0];
return async (...args) => await handleMiddleware(args[0], options);
}
var _default = exports.default = withAuth;

6
node_modules/next-auth/next/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { Cookie } from "../core/lib/cookie";
import { type ResponseInternal } from "../core";
export declare function setCookie(res: any, cookie: Cookie): void;
export declare function getBody(req: Request): Promise<Record<string, any> | undefined>;
export declare function toResponse(res: ResponseInternal): Response;
//# sourceMappingURL=utils.d.ts.map

1
node_modules/next-auth/next/utils.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/next/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,wBAAgB,SAAS,CAAC,GAAG,KAAA,EAAE,MAAM,EAAE,MAAM,QAW5C;AAED,wBAAsB,OAAO,CAC3B,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,CAU1C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,gBAAgB,GAAG,QAAQ,CA4B1D"}

62
node_modules/next-auth/next/utils.js generated vendored Normal file
View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getBody = getBody;
exports.setCookie = setCookie;
exports.toResponse = toResponse;
var _cookie = require("cookie");
function setCookie(res, cookie) {
var _res$getHeader;
let setCookieHeader = (_res$getHeader = res.getHeader("Set-Cookie")) !== null && _res$getHeader !== void 0 ? _res$getHeader : [];
if (!Array.isArray(setCookieHeader)) {
setCookieHeader = [setCookieHeader];
}
const {
name,
value,
options
} = cookie;
const cookieHeader = (0, _cookie.serialize)(name, value, options);
setCookieHeader.push(cookieHeader);
res.setHeader("Set-Cookie", setCookieHeader);
}
async function getBody(req) {
if (!("body" in req) || !req.body || req.method !== "POST") return;
const contentType = req.headers.get("content-type");
if (contentType !== null && contentType !== void 0 && contentType.includes("application/json")) {
return await req.json();
} else if (contentType !== null && contentType !== void 0 && contentType.includes("application/x-www-form-urlencoded")) {
const params = new URLSearchParams(await req.text());
return Object.fromEntries(params);
}
}
function toResponse(res) {
var _res$headers, _res$cookies, _res$status;
const headers = new Headers((_res$headers = res.headers) === null || _res$headers === void 0 ? void 0 : _res$headers.reduce((acc, {
key,
value
}) => {
acc[key] = value;
return acc;
}, {}));
(_res$cookies = res.cookies) === null || _res$cookies === void 0 || _res$cookies.forEach(cookie => {
const {
name,
value,
options
} = cookie;
const cookieHeader = (0, _cookie.serialize)(name, value, options);
if (headers.has("Set-Cookie")) headers.append("Set-Cookie", cookieHeader);else headers.set("Set-Cookie", cookieHeader);
});
let body = res.body;
if (headers.get("content-type") === "application/json") body = JSON.stringify(res.body);else if (headers.get("content-type") === "application/x-www-form-urlencoded") body = new URLSearchParams(res.body).toString();
const status = res.redirect ? 302 : (_res$status = res.status) !== null && _res$status !== void 0 ? _res$status : 200;
const response = new Response(body, {
headers,
status
});
if (res.redirect) response.headers.set("Location", res.redirect);
return response;
}