Auto-commit 2026-04-29 16:31
This commit is contained in:
23
node_modules/next-auth/utils/parse-url.js
generated
vendored
Normal file
23
node_modules/next-auth/utils/parse-url.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseUrl;
|
||||
function parseUrl(url) {
|
||||
var _url2;
|
||||
const defaultUrl = new URL("http://localhost:3000/api/auth");
|
||||
if (url && !url.startsWith("http")) {
|
||||
url = `https://${url}`;
|
||||
}
|
||||
const _url = new URL((_url2 = url) !== null && _url2 !== void 0 ? _url2 : defaultUrl);
|
||||
const path = (_url.pathname === "/" ? defaultUrl.pathname : _url.pathname).replace(/\/$/, "");
|
||||
const base = `${_url.origin}${path}`;
|
||||
return {
|
||||
origin: _url.origin,
|
||||
host: _url.host,
|
||||
path,
|
||||
base,
|
||||
toString: () => base
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user