@better-auth/electron 1.5.7-beta.1 → 1.6.0
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-D8BB_eSV.d.mts → client-D6xRwPM0.d.mts} +11 -3
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +3 -1
- package/dist/index.d.mts +141 -124
- package/dist/index.mjs +2 -0
- package/dist/preload.d.mts +766 -562
- package/dist/preload.mjs +2 -61
- package/dist/proxy.d.mts +2 -1
- package/dist/proxy.mjs +3 -1
- package/dist/storage.d.mts +1 -1
- package/dist/version-Cf5gNNxE.mjs +5 -0
- package/package.json +9 -8
- /package/dist/{utils-CRzg_SlK.mjs → utils-DxDKRT6e.mjs} +0 -0
package/dist/preload.mjs
CHANGED
|
@@ -1,68 +1,9 @@
|
|
|
1
1
|
import electron, { contextBridge } from "electron";
|
|
2
|
-
//#region
|
|
3
|
-
function defineErrorCodes(codes) {
|
|
4
|
-
return Object.fromEntries(Object.entries(codes).map(([key, value]) => [key, {
|
|
5
|
-
code: key,
|
|
6
|
-
message: value,
|
|
7
|
-
toString: () => key
|
|
8
|
-
}]));
|
|
9
|
-
}
|
|
10
|
-
defineErrorCodes({
|
|
11
|
-
USER_NOT_FOUND: "User not found",
|
|
12
|
-
FAILED_TO_CREATE_USER: "Failed to create user",
|
|
13
|
-
FAILED_TO_CREATE_SESSION: "Failed to create session",
|
|
14
|
-
FAILED_TO_UPDATE_USER: "Failed to update user",
|
|
15
|
-
FAILED_TO_GET_SESSION: "Failed to get session",
|
|
16
|
-
INVALID_PASSWORD: "Invalid password",
|
|
17
|
-
INVALID_EMAIL: "Invalid email",
|
|
18
|
-
INVALID_EMAIL_OR_PASSWORD: "Invalid email or password",
|
|
19
|
-
INVALID_USER: "Invalid user",
|
|
20
|
-
SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked",
|
|
21
|
-
PROVIDER_NOT_FOUND: "Provider not found",
|
|
22
|
-
INVALID_TOKEN: "Invalid token",
|
|
23
|
-
TOKEN_EXPIRED: "Token expired",
|
|
24
|
-
ID_TOKEN_NOT_SUPPORTED: "id_token not supported",
|
|
25
|
-
FAILED_TO_GET_USER_INFO: "Failed to get user info",
|
|
26
|
-
USER_EMAIL_NOT_FOUND: "User email not found",
|
|
27
|
-
EMAIL_NOT_VERIFIED: "Email not verified",
|
|
28
|
-
PASSWORD_TOO_SHORT: "Password too short",
|
|
29
|
-
PASSWORD_TOO_LONG: "Password too long",
|
|
30
|
-
USER_ALREADY_EXISTS: "User already exists.",
|
|
31
|
-
USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.",
|
|
32
|
-
EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated",
|
|
33
|
-
CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found",
|
|
34
|
-
SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.",
|
|
35
|
-
FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account",
|
|
36
|
-
ACCOUNT_NOT_FOUND: "Account not found",
|
|
37
|
-
USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.",
|
|
38
|
-
CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.",
|
|
39
|
-
VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled",
|
|
40
|
-
EMAIL_ALREADY_VERIFIED: "Email is already verified",
|
|
41
|
-
EMAIL_MISMATCH: "Email mismatch",
|
|
42
|
-
SESSION_NOT_FRESH: "Session is not fresh",
|
|
43
|
-
LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists",
|
|
44
|
-
INVALID_ORIGIN: "Invalid origin",
|
|
45
|
-
INVALID_CALLBACK_URL: "Invalid callbackURL",
|
|
46
|
-
INVALID_REDIRECT_URL: "Invalid redirectURL",
|
|
47
|
-
INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL",
|
|
48
|
-
INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL",
|
|
49
|
-
MISSING_OR_NULL_ORIGIN: "Missing or null Origin",
|
|
50
|
-
CALLBACK_URL_REQUIRED: "callbackURL is required",
|
|
51
|
-
FAILED_TO_CREATE_VERIFICATION: "Unable to create verification",
|
|
52
|
-
FIELD_NOT_ALLOWED: "Field not allowed to be set",
|
|
53
|
-
ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported",
|
|
54
|
-
VALIDATION_ERROR: "Validation Error",
|
|
55
|
-
MISSING_FIELD: "Field is required",
|
|
56
|
-
METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: "POST method requires deferSessionRefresh to be enabled in session config",
|
|
57
|
-
BODY_MUST_BE_AN_OBJECT: "Body must be an object",
|
|
58
|
-
PASSWORD_ALREADY_SET: "User already has a password set"
|
|
59
|
-
});
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region ../../node_modules/.pnpm/better-call@2.0.2_zod@4.3.6/node_modules/better-call/dist/error.mjs
|
|
2
|
+
//#region ../../node_modules/.pnpm/better-call@1.3.5_zod@4.3.6/node_modules/better-call/dist/error.mjs
|
|
62
3
|
function isErrorStackTraceLimitWritable() {
|
|
63
4
|
const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
64
5
|
if (desc === void 0) return Object.isExtensible(Error);
|
|
65
|
-
return Object.
|
|
6
|
+
return Object.prototype.hasOwnProperty.call(desc, "writable") ? desc.writable : desc.set !== void 0;
|
|
66
7
|
}
|
|
67
8
|
/**
|
|
68
9
|
* Hide internal stack frames from the error stack trace.
|
package/dist/proxy.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { l as ElectronProxyClientOptions } from "./client-
|
|
1
|
+
import { l as ElectronProxyClientOptions } from "./client-D6xRwPM0.mjs";
|
|
2
2
|
import { electron } from "./index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/proxy.d.ts
|
|
5
5
|
declare const electronProxyClient: (options: ElectronProxyClientOptions) => {
|
|
6
6
|
id: "electron-proxy";
|
|
7
|
+
version: string;
|
|
7
8
|
getActions: () => {
|
|
8
9
|
electron: {
|
|
9
10
|
/**
|
package/dist/proxy.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-Cf5gNNxE.mjs";
|
|
2
|
+
import { r as parseProtocolScheme } from "./utils-DxDKRT6e.mjs";
|
|
2
3
|
import { parseCookies } from "better-auth/cookies";
|
|
3
4
|
//#region src/proxy.ts
|
|
4
5
|
const electronProxyClient = (options) => {
|
|
@@ -12,6 +13,7 @@ const electronProxyClient = (options) => {
|
|
|
12
13
|
const { scheme } = parseProtocolScheme(opts.protocol);
|
|
13
14
|
return {
|
|
14
15
|
id: "electron-proxy",
|
|
16
|
+
version: PACKAGE_VERSION,
|
|
15
17
|
getActions: () => {
|
|
16
18
|
const getAuthorizationCode = () => {
|
|
17
19
|
if (typeof document === "undefined") return null;
|
package/dist/storage.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/electron",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Better Auth integration for Electron applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
|
+
"sideEffects": false,
|
|
22
23
|
"files": [
|
|
23
24
|
"dist"
|
|
24
25
|
],
|
|
@@ -79,17 +80,17 @@
|
|
|
79
80
|
"better-sqlite3": "^12.6.2",
|
|
80
81
|
"electron": "^38.8.4",
|
|
81
82
|
"tsdown": "0.21.1",
|
|
82
|
-
"@better-auth/core": "1.
|
|
83
|
-
"better-auth": "1.
|
|
83
|
+
"@better-auth/core": "1.6.0",
|
|
84
|
+
"better-auth": "1.6.0"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
|
-
"@better-auth/utils": "0.
|
|
87
|
+
"@better-auth/utils": "0.4.0",
|
|
87
88
|
"@better-fetch/fetch": "1.1.21",
|
|
88
|
-
"better-call": "
|
|
89
|
+
"better-call": "1.3.5",
|
|
89
90
|
"conf": "^15.0.2",
|
|
90
91
|
"electron": ">=36.0.0",
|
|
91
|
-
"@better-auth/core": "1.
|
|
92
|
-
"better-auth": "1.
|
|
92
|
+
"@better-auth/core": "^1.6.0",
|
|
93
|
+
"better-auth": "^1.6.0"
|
|
93
94
|
},
|
|
94
95
|
"peerDependenciesMeta": {
|
|
95
96
|
"electron": {
|
|
@@ -105,7 +106,7 @@
|
|
|
105
106
|
"scripts": {
|
|
106
107
|
"build": "tsdown",
|
|
107
108
|
"dev": "tsdown --watch",
|
|
108
|
-
"lint:package": "publint run --strict",
|
|
109
|
+
"lint:package": "publint run --strict --pack false",
|
|
109
110
|
"lint:types": "attw --profile esm-only --pack .",
|
|
110
111
|
"typecheck": "tsc --project tsconfig.json",
|
|
111
112
|
"test": "vitest",
|
|
File without changes
|