@better-auth/electron 1.6.4 → 1.6.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/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-G_DbEvps.mjs";
|
|
2
2
|
import { n as isProcessType, r as parseProtocolScheme, t as getChannelPrefixWithDelimiter } from "./utils-DxDKRT6e.mjs";
|
|
3
3
|
import { BetterAuthError } from "@better-auth/core/error";
|
|
4
4
|
import { base64, base64Url } from "@better-auth/utils/base64";
|
|
@@ -11,6 +11,7 @@ import { signInSocial } from "better-auth/api";
|
|
|
11
11
|
import { parseSetCookieHeader } from "better-auth/cookies";
|
|
12
12
|
import electron, { shell } from "electron";
|
|
13
13
|
import { isDevelopment as isDevelopment$1 } from "@better-auth/core/env";
|
|
14
|
+
import { isPublicRoutableHost } from "@better-auth/core/utils/host";
|
|
14
15
|
import { resolve } from "node:path";
|
|
15
16
|
//#region src/user.ts
|
|
16
17
|
const { net } = electron;
|
|
@@ -37,7 +38,7 @@ async function fetchUserImage(baseURL, url, options) {
|
|
|
37
38
|
parsed = new URL(relative, base);
|
|
38
39
|
}
|
|
39
40
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
40
|
-
if (!isDevelopment$1() &&
|
|
41
|
+
if (!isDevelopment$1() && !isPublicRoutableHost(parsed.hostname)) return null;
|
|
41
42
|
resolvedUrl = parsed.href;
|
|
42
43
|
} catch {
|
|
43
44
|
return null;
|
|
@@ -116,25 +117,6 @@ async function decodeDataImageUrl(url, options) {
|
|
|
116
117
|
return null;
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
function isLocalOrigin(parsed) {
|
|
120
|
-
const hostname = parsed.hostname.toLowerCase();
|
|
121
|
-
if (hostname === "localhost") return true;
|
|
122
|
-
const m = hostname.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
|
|
123
|
-
if (m) {
|
|
124
|
-
const a = Number(m[1]);
|
|
125
|
-
const b = Number(m[2]);
|
|
126
|
-
if (a === 127) return true;
|
|
127
|
-
if (a === 10) return true;
|
|
128
|
-
if (a === 172 && b >= 16 && b <= 31) return true;
|
|
129
|
-
if (a === 192 && b === 168) return true;
|
|
130
|
-
if (a === 169 && b === 254) return true;
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
const h = hostname.replace(/^\[|\]$/g, "");
|
|
134
|
-
if (h === "::1" || /^(0:){7}1$/.test(h) || h === "0:0:0:0:0:0:0:1") return true;
|
|
135
|
-
if (/^fe[89ab][0-9a-f]/i.test(h)) return true;
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
120
|
function detectImageType(bytes) {
|
|
139
121
|
if (bytes.length < 12) return null;
|
|
140
122
|
if (bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71 && bytes[4] === 13 && bytes[5] === 10 && bytes[6] === 26 && bytes[7] === 10) return "image/png";
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-G_DbEvps.mjs";
|
|
2
2
|
import { createAuthMiddleware } from "@better-auth/core/api";
|
|
3
3
|
import { APIError, BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
4
4
|
import { base64Url } from "@better-auth/utils/base64";
|
package/dist/proxy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-G_DbEvps.mjs";
|
|
2
2
|
import { r as parseProtocolScheme } from "./utils-DxDKRT6e.mjs";
|
|
3
3
|
import { parseCookies } from "better-auth/cookies";
|
|
4
4
|
//#region src/proxy.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/electron",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Better Auth integration for Electron applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"better-sqlite3": "^12.6.2",
|
|
81
81
|
"electron": "^38.8.6",
|
|
82
82
|
"tsdown": "0.21.1",
|
|
83
|
-
"@better-auth/core": "1.6.
|
|
84
|
-
"better-auth": "1.6.
|
|
83
|
+
"@better-auth/core": "1.6.6",
|
|
84
|
+
"better-auth": "1.6.6"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@better-auth/utils": "0.4.0",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"better-call": "1.3.5",
|
|
90
90
|
"conf": "^15.0.2",
|
|
91
91
|
"electron": ">=36.0.0",
|
|
92
|
-
"@better-auth/core": "^1.6.
|
|
93
|
-
"better-auth": "^1.6.
|
|
92
|
+
"@better-auth/core": "^1.6.6",
|
|
93
|
+
"better-auth": "^1.6.6"
|
|
94
94
|
},
|
|
95
95
|
"peerDependenciesMeta": {
|
|
96
96
|
"electron": {
|