@better-auth/electron 1.7.0-rc.4 → 1.7.0-rc.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-Cw8Yl2yP.d.mts → client-BLUnuwWr.d.mts} +41 -26
- package/dist/client.d.mts +2 -2
- package/dist/client.mjs +3 -3
- package/dist/index.d.mts +41 -37
- package/dist/index.mjs +1 -1
- package/dist/preload.d.mts +0 -2
- package/dist/preload.mjs +5 -1
- package/dist/proxy.d.mts +2 -1
- package/dist/proxy.mjs +2 -2
- package/dist/storage.d.mts +2 -1
- package/dist/{version-Do0kTnv7.mjs → version-CceXYJfW.mjs} +1 -1
- package/package.json +7 -7
- /package/dist/{utils-C5XBRvIU.mjs → utils-DxDKRT6e.mjs} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import * as _$better_auth0 from "better-auth";
|
|
1
2
|
import { ClientStore } from "better-auth";
|
|
2
3
|
import * as z from "zod";
|
|
4
|
+
import * as _$_better_fetch_fetch0 from "@better-fetch/fetch";
|
|
3
5
|
import { BetterFetch, BetterFetchError, CreateFetchOption } from "@better-fetch/fetch";
|
|
4
6
|
import electron from "electron";
|
|
5
7
|
import { Awaitable, BetterAuthClientOptions } from "@better-auth/core";
|
|
6
8
|
import { User } from "@better-auth/core/db";
|
|
9
|
+
|
|
7
10
|
//#region src/types/options.d.ts
|
|
8
11
|
interface ElectronSharedOptions {
|
|
9
12
|
/**
|
|
@@ -253,7 +256,13 @@ interface ElectronAuthenticateOptions {
|
|
|
253
256
|
/**
|
|
254
257
|
* Exchanges the authorization code for a session.
|
|
255
258
|
*/
|
|
256
|
-
declare function authenticate({
|
|
259
|
+
declare function authenticate({
|
|
260
|
+
$fetch,
|
|
261
|
+
options,
|
|
262
|
+
token,
|
|
263
|
+
getWindow,
|
|
264
|
+
fetchOptions
|
|
265
|
+
}: ElectronAuthenticateOptions & {
|
|
257
266
|
$fetch: BetterFetch;
|
|
258
267
|
options: ElectronClientOptions;
|
|
259
268
|
getWindow: () => Electron.BrowserWindow | null | undefined;
|
|
@@ -282,7 +291,13 @@ type SetupMainConfig = {
|
|
|
282
291
|
/**
|
|
283
292
|
* Handles the deep link URL for authentication.
|
|
284
293
|
*/
|
|
285
|
-
declare function handleDeepLink({
|
|
294
|
+
declare function handleDeepLink({
|
|
295
|
+
$fetch,
|
|
296
|
+
options,
|
|
297
|
+
url,
|
|
298
|
+
getWindow,
|
|
299
|
+
clientOptions
|
|
300
|
+
}: {
|
|
286
301
|
$fetch: BetterFetch;
|
|
287
302
|
options: ElectronClientOptions;
|
|
288
303
|
url: string;
|
|
@@ -310,17 +325,17 @@ declare const electronClient: <O extends ElectronClientOptions>(options: O) => {
|
|
|
310
325
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
311
326
|
signal?: (AbortSignal | null) | undefined;
|
|
312
327
|
window?: null | undefined;
|
|
313
|
-
onRequest?: (<T extends Record<string, any>>(context:
|
|
314
|
-
onResponse?: ((context:
|
|
315
|
-
onSuccess?: ((context:
|
|
316
|
-
onError?: ((context:
|
|
317
|
-
onRetry?: ((response:
|
|
328
|
+
onRequest?: (<T extends Record<string, any>>(context: _$_better_fetch_fetch0.RequestContext<T>) => Promise<_$_better_fetch_fetch0.RequestContext | void> | _$_better_fetch_fetch0.RequestContext | void) | undefined;
|
|
329
|
+
onResponse?: ((context: _$_better_fetch_fetch0.ResponseContext) => Promise<Response | void | _$_better_fetch_fetch0.ResponseContext> | Response | _$_better_fetch_fetch0.ResponseContext | void) | undefined;
|
|
330
|
+
onSuccess?: ((context: _$_better_fetch_fetch0.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
331
|
+
onError?: ((context: _$_better_fetch_fetch0.ErrorContext) => Promise<void> | void) | undefined;
|
|
332
|
+
onRetry?: ((response: _$_better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
|
|
318
333
|
hookOptions?: {
|
|
319
334
|
cloneResponse?: boolean;
|
|
320
335
|
} | undefined;
|
|
321
336
|
timeout?: number | undefined;
|
|
322
|
-
customFetchImpl?:
|
|
323
|
-
plugins?:
|
|
337
|
+
customFetchImpl?: _$_better_fetch_fetch0.FetchEsque | undefined;
|
|
338
|
+
plugins?: _$_better_fetch_fetch0.BetterFetchPlugin[] | undefined;
|
|
324
339
|
baseURL?: string | undefined;
|
|
325
340
|
throw?: boolean | undefined;
|
|
326
341
|
auth?: ({
|
|
@@ -346,10 +361,10 @@ declare const electronClient: <O extends ElectronClientOptions>(options: O) => {
|
|
|
346
361
|
params?: any;
|
|
347
362
|
duplex?: "full" | "half" | undefined;
|
|
348
363
|
jsonParser?: ((text: string) => Promise<any> | any) | undefined;
|
|
349
|
-
retry?:
|
|
364
|
+
retry?: _$_better_fetch_fetch0.RetryOptions | undefined;
|
|
350
365
|
retryAttempt?: number | undefined;
|
|
351
|
-
output?: (
|
|
352
|
-
errorSchema?:
|
|
366
|
+
output?: (_$_better_fetch_fetch0.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
367
|
+
errorSchema?: _$_better_fetch_fetch0.StandardSchemaV1 | undefined;
|
|
353
368
|
disableValidation?: boolean | undefined;
|
|
354
369
|
} & Record<string, any>) | undefined): Promise<{
|
|
355
370
|
url: string;
|
|
@@ -366,17 +381,17 @@ declare const electronClient: <O extends ElectronClientOptions>(options: O) => {
|
|
|
366
381
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
367
382
|
signal?: (AbortSignal | null) | undefined;
|
|
368
383
|
window?: null | undefined;
|
|
369
|
-
onRequest?: (<T extends Record<string, any>>(context:
|
|
370
|
-
onResponse?: ((context:
|
|
371
|
-
onSuccess?: ((context:
|
|
372
|
-
onError?: ((context:
|
|
373
|
-
onRetry?: ((response:
|
|
384
|
+
onRequest?: (<T extends Record<string, any>>(context: _$_better_fetch_fetch0.RequestContext<T>) => Promise<_$_better_fetch_fetch0.RequestContext | void> | _$_better_fetch_fetch0.RequestContext | void) | undefined;
|
|
385
|
+
onResponse?: ((context: _$_better_fetch_fetch0.ResponseContext) => Promise<Response | void | _$_better_fetch_fetch0.ResponseContext> | Response | _$_better_fetch_fetch0.ResponseContext | void) | undefined;
|
|
386
|
+
onSuccess?: ((context: _$_better_fetch_fetch0.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
387
|
+
onError?: ((context: _$_better_fetch_fetch0.ErrorContext) => Promise<void> | void) | undefined;
|
|
388
|
+
onRetry?: ((response: _$_better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
|
|
374
389
|
hookOptions?: {
|
|
375
390
|
cloneResponse?: boolean;
|
|
376
391
|
} | undefined;
|
|
377
392
|
timeout?: number | undefined;
|
|
378
|
-
customFetchImpl?:
|
|
379
|
-
plugins?:
|
|
393
|
+
customFetchImpl?: _$_better_fetch_fetch0.FetchEsque | undefined;
|
|
394
|
+
plugins?: _$_better_fetch_fetch0.BetterFetchPlugin[] | undefined;
|
|
380
395
|
baseURL?: string | undefined;
|
|
381
396
|
throw?: boolean | undefined;
|
|
382
397
|
auth?: ({
|
|
@@ -402,19 +417,19 @@ declare const electronClient: <O extends ElectronClientOptions>(options: O) => {
|
|
|
402
417
|
params?: any;
|
|
403
418
|
duplex?: "full" | "half" | undefined;
|
|
404
419
|
jsonParser?: ((text: string) => Promise<any> | any) | undefined;
|
|
405
|
-
retry?:
|
|
420
|
+
retry?: _$_better_fetch_fetch0.RetryOptions | undefined;
|
|
406
421
|
retryAttempt?: number | undefined;
|
|
407
|
-
output?: (
|
|
408
|
-
errorSchema?:
|
|
422
|
+
output?: (_$_better_fetch_fetch0.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
423
|
+
errorSchema?: _$_better_fetch_fetch0.StandardSchemaV1 | undefined;
|
|
409
424
|
disableValidation?: boolean | undefined;
|
|
410
425
|
} & Record<string, any>;
|
|
411
426
|
}>;
|
|
412
427
|
hooks: {
|
|
413
|
-
onSuccess: (context:
|
|
414
|
-
onError: (context:
|
|
428
|
+
onSuccess: (context: _$_better_fetch_fetch0.SuccessContext<any>) => Promise<void>;
|
|
429
|
+
onError: (context: _$_better_fetch_fetch0.ErrorContext) => Promise<void>;
|
|
415
430
|
};
|
|
416
431
|
}[];
|
|
417
|
-
getActions: ($fetch: BetterFetch, $store: ClientStore, clientOptions:
|
|
432
|
+
getActions: ($fetch: BetterFetch, $store: ClientStore, clientOptions: _$better_auth0.BetterAuthClientOptions | undefined) => {
|
|
418
433
|
/**
|
|
419
434
|
* Gets the stored cookie.
|
|
420
435
|
*
|
|
@@ -452,7 +467,7 @@ declare const electronClient: <O extends ElectronClientOptions>(options: O) => {
|
|
|
452
467
|
} | {
|
|
453
468
|
data: {
|
|
454
469
|
token: string;
|
|
455
|
-
user:
|
|
470
|
+
user: _$better_auth0.User & Record<string, any>;
|
|
456
471
|
};
|
|
457
472
|
error: null;
|
|
458
473
|
}>;
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as setupRenderer, a as authenticate, c as ElectronClientOptions, d as Storage, f as FetchUserImageResult, g as SetupRendererConfig, h as ExposedBridges, i as ElectronRequestAuthOptions, l as ElectronProxyClientOptions, m as normalizeUserOutput, n as handleDeepLink, o as kElectron, p as fetchUserImage, r as ElectronAuthenticateOptions, s as requestAuth, t as electronClient, u as ElectronSharedClientOptions, y as ElectronSharedOptions } from "./client-
|
|
2
|
-
export {
|
|
1
|
+
import { _ as setupRenderer, a as authenticate, c as ElectronClientOptions, d as Storage, f as FetchUserImageResult, g as SetupRendererConfig, h as ExposedBridges, i as ElectronRequestAuthOptions, l as ElectronProxyClientOptions, m as normalizeUserOutput, n as handleDeepLink, o as kElectron, p as fetchUserImage, r as ElectronAuthenticateOptions, s as requestAuth, t as electronClient, u as ElectronSharedClientOptions, y as ElectronSharedOptions } from "./client-BLUnuwWr.mjs";
|
|
2
|
+
export { ElectronAuthenticateOptions, ElectronClientOptions, ElectronProxyClientOptions, ElectronRequestAuthOptions, ElectronSharedClientOptions, ElectronSharedOptions, ExposedBridges, FetchUserImageResult, SetupRendererConfig, Storage, authenticate, electronClient, fetchUserImage, handleDeepLink, kElectron, normalizeUserOutput, requestAuth, setupRenderer };
|
package/dist/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
2
|
-
import { n as isProcessType, r as parseProtocolScheme, t as getChannelPrefixWithDelimiter } from "./utils-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-CceXYJfW.mjs";
|
|
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";
|
|
5
5
|
import { APIError as APIError$1, getBaseURL, isDevelopment, isTest, safeJSONParse } from "better-auth";
|
|
@@ -577,7 +577,7 @@ const electronClient = (options) => {
|
|
|
577
577
|
let store = null;
|
|
578
578
|
const cookieName = `${opts.storagePrefix}.cookie`;
|
|
579
579
|
const localCacheName = `${opts.storagePrefix}.local_cache`;
|
|
580
|
-
const { getDecrypted, setEncrypted } = storageAdapter(opts.storage,
|
|
580
|
+
const { getDecrypted, setEncrypted } = storageAdapter(opts.storage, new Set([cookieName, localCacheName]));
|
|
581
581
|
const clearSessionCache = () => {
|
|
582
582
|
setEncrypted(cookieName, "{}");
|
|
583
583
|
store?.atoms.session?.set({
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { f as FetchUserImageResult, m as normalizeUserOutput, p as fetchUserImage, v as ElectronOptions, y as ElectronSharedOptions } from "./client-
|
|
1
|
+
import { f as FetchUserImageResult, m as normalizeUserOutput, p as fetchUserImage, v as ElectronOptions, y as ElectronSharedOptions } from "./client-BLUnuwWr.mjs";
|
|
2
|
+
import * as _$better_auth0 from "better-auth";
|
|
2
3
|
import * as z from "zod";
|
|
4
|
+
import * as _$_better_auth_core0 from "@better-auth/core";
|
|
3
5
|
import { HookEndpointContext } from "@better-auth/core";
|
|
6
|
+
import * as _$better_call0 from "better-call";
|
|
7
|
+
|
|
4
8
|
//#region src/index.d.ts
|
|
5
9
|
declare module "@better-auth/core" {
|
|
6
10
|
interface BetterAuthPluginRegistry<AuthOptions, Options> {
|
|
@@ -15,14 +19,11 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
15
19
|
hooks: {
|
|
16
20
|
after: ({
|
|
17
21
|
matcher: (ctx: HookEndpointContext) => boolean;
|
|
18
|
-
handler: (inputContext:
|
|
22
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
19
23
|
} | {
|
|
20
24
|
matcher: (ctx: HookEndpointContext) => boolean;
|
|
21
|
-
handler: (inputContext:
|
|
22
|
-
|
|
23
|
-
responseHeaders?: Headers | undefined;
|
|
24
|
-
} & import("better-auth").PluginContext<import("better-auth").BetterAuthOptions> & import("better-auth").InfoContext & {
|
|
25
|
-
options: import("better-auth").BetterAuthOptions;
|
|
25
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<_$better_call0.MiddlewareContext<_$better_call0.MiddlewareOptions, _$better_auth0.PluginContext<_$better_auth0.BetterAuthOptions> & _$better_auth0.InfoContext & {
|
|
26
|
+
options: _$better_auth0.BetterAuthOptions;
|
|
26
27
|
trustedOrigins: string[];
|
|
27
28
|
trustedProviders: string[];
|
|
28
29
|
isTrustedOrigin: (url: string, settings?: {
|
|
@@ -95,35 +96,35 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
95
96
|
image?: string | null | undefined;
|
|
96
97
|
} & Record<string, any>;
|
|
97
98
|
} | null) => void;
|
|
98
|
-
socialProviders:
|
|
99
|
-
authCookies:
|
|
100
|
-
logger: ReturnType<typeof
|
|
99
|
+
socialProviders: _$better_auth0.OAuthProvider[];
|
|
100
|
+
authCookies: _$better_auth0.BetterAuthCookies;
|
|
101
|
+
logger: ReturnType<typeof _$better_auth0.createLogger>;
|
|
101
102
|
rateLimit: {
|
|
102
103
|
enabled: boolean;
|
|
103
104
|
window: number;
|
|
104
105
|
max: number;
|
|
105
106
|
storage: "memory" | "database" | "secondary-storage";
|
|
106
|
-
} & Omit<
|
|
107
|
-
adapter:
|
|
108
|
-
internalAdapter:
|
|
109
|
-
createAuthCookie: (cookieName: string, overrideAttributes?: Partial<
|
|
107
|
+
} & Omit<_$better_auth0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
|
|
108
|
+
adapter: _$better_auth0.DBAdapter<_$better_auth0.BetterAuthOptions>;
|
|
109
|
+
internalAdapter: _$better_auth0.InternalAdapter<_$better_auth0.BetterAuthOptions>;
|
|
110
|
+
createAuthCookie: (cookieName: string, overrideAttributes?: Partial<_$better_call0.CookieOptions> | undefined) => _$better_auth0.BetterAuthCookie;
|
|
110
111
|
secret: string;
|
|
111
|
-
secretConfig: string |
|
|
112
|
+
secretConfig: string | _$better_auth0.SecretConfig;
|
|
112
113
|
sessionConfig: {
|
|
113
114
|
updateAge: number;
|
|
114
115
|
expiresIn: number;
|
|
115
116
|
freshAge: number;
|
|
116
|
-
cookieCacheSigner?:
|
|
117
|
+
cookieCacheSigner?: _$better_auth0.CookieCacheSigner | undefined;
|
|
117
118
|
cookieRefreshCache: false | {
|
|
118
119
|
enabled: true;
|
|
119
120
|
updateAge: number;
|
|
120
121
|
};
|
|
121
122
|
};
|
|
122
123
|
generateId: (options: {
|
|
123
|
-
model:
|
|
124
|
+
model: _$better_auth0.ModelNames;
|
|
124
125
|
size?: number | undefined;
|
|
125
126
|
}) => string | false;
|
|
126
|
-
secondaryStorage:
|
|
127
|
+
secondaryStorage: _$better_auth0.SecondaryStorage | undefined;
|
|
127
128
|
password: {
|
|
128
129
|
hash: (password: string) => Promise<string>;
|
|
129
130
|
verify: (data: {
|
|
@@ -134,9 +135,9 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
134
135
|
minPasswordLength: number;
|
|
135
136
|
maxPasswordLength: number;
|
|
136
137
|
};
|
|
137
|
-
checkPassword: (userId: string, ctx:
|
|
138
|
+
checkPassword: (userId: string, ctx: _$_better_auth_core0.GenericEndpointContext<_$better_auth0.BetterAuthOptions>) => Promise<boolean>;
|
|
138
139
|
};
|
|
139
|
-
tables:
|
|
140
|
+
tables: _$better_auth0.BetterAuthDBSchema;
|
|
140
141
|
runMigrations: () => Promise<void>;
|
|
141
142
|
publishTelemetry: (event: {
|
|
142
143
|
type: string;
|
|
@@ -146,14 +147,17 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
146
147
|
skipOriginCheck: boolean | string[];
|
|
147
148
|
skipCSRFCheck: boolean;
|
|
148
149
|
runInBackground: (promise: Promise<unknown>) => void;
|
|
149
|
-
runInBackgroundOrAwait: (promise: Promise<unknown> | void) =>
|
|
150
|
+
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => _$better_auth0.Awaitable<unknown>;
|
|
151
|
+
} & {
|
|
152
|
+
returned?: unknown | undefined;
|
|
153
|
+
responseHeaders?: Headers | undefined;
|
|
150
154
|
}> | {
|
|
151
155
|
electron_authorization_code: string;
|
|
152
|
-
} | undefined
|
|
156
|
+
} | undefined>>;
|
|
153
157
|
})[];
|
|
154
158
|
};
|
|
155
159
|
endpoints: {
|
|
156
|
-
electronToken:
|
|
160
|
+
electronToken: _$better_call0.StrictEndpoint<"/electron/token", {
|
|
157
161
|
method: "POST";
|
|
158
162
|
body: z.ZodObject<{
|
|
159
163
|
token: z.ZodString;
|
|
@@ -191,9 +195,9 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
191
195
|
};
|
|
192
196
|
}, {
|
|
193
197
|
token: string;
|
|
194
|
-
user:
|
|
198
|
+
user: _$better_auth0.User & Record<string, any>;
|
|
195
199
|
}>;
|
|
196
|
-
electronInitOAuthProxy:
|
|
200
|
+
electronInitOAuthProxy: _$better_call0.StrictEndpoint<"/electron/init-oauth-proxy", {
|
|
197
201
|
method: "GET";
|
|
198
202
|
query: z.ZodObject<{
|
|
199
203
|
provider: z.ZodString;
|
|
@@ -239,10 +243,10 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
239
243
|
}, {
|
|
240
244
|
url: string | undefined;
|
|
241
245
|
redirect: boolean;
|
|
242
|
-
user?:
|
|
246
|
+
user?: _$better_auth0.User & Record<string, any>;
|
|
243
247
|
token?: string;
|
|
244
248
|
} | undefined>;
|
|
245
|
-
electronTransferUser:
|
|
249
|
+
electronTransferUser: _$better_call0.StrictEndpoint<"/electron/transfer-user", {
|
|
246
250
|
method: "POST";
|
|
247
251
|
query: z.ZodObject<{
|
|
248
252
|
client_id: z.ZodString;
|
|
@@ -252,7 +256,7 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
252
256
|
body: z.ZodObject<{
|
|
253
257
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
254
258
|
}, z.core.$strip>;
|
|
255
|
-
use: (
|
|
259
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
256
260
|
session: {
|
|
257
261
|
session: Record<string, any> & {
|
|
258
262
|
id: string;
|
|
@@ -274,7 +278,7 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
274
278
|
image?: string | null | undefined;
|
|
275
279
|
};
|
|
276
280
|
};
|
|
277
|
-
}
|
|
281
|
+
}>>[];
|
|
278
282
|
requireHeaders: true;
|
|
279
283
|
metadata: {
|
|
280
284
|
openapi: {
|
|
@@ -320,14 +324,14 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
320
324
|
clientID: string;
|
|
321
325
|
};
|
|
322
326
|
$ERROR_CODES: {
|
|
323
|
-
INVALID_TOKEN:
|
|
324
|
-
INVALID_CLIENT_ID:
|
|
325
|
-
STATE_MISMATCH:
|
|
326
|
-
MISSING_CODE_CHALLENGE:
|
|
327
|
-
INVALID_CODE_VERIFIER:
|
|
328
|
-
MISSING_STATE:
|
|
329
|
-
MISSING_PKCE:
|
|
327
|
+
INVALID_TOKEN: _$better_auth0.RawError<"INVALID_TOKEN">;
|
|
328
|
+
INVALID_CLIENT_ID: _$better_auth0.RawError<"INVALID_CLIENT_ID">;
|
|
329
|
+
STATE_MISMATCH: _$better_auth0.RawError<"STATE_MISMATCH">;
|
|
330
|
+
MISSING_CODE_CHALLENGE: _$better_auth0.RawError<"MISSING_CODE_CHALLENGE">;
|
|
331
|
+
INVALID_CODE_VERIFIER: _$better_auth0.RawError<"INVALID_CODE_VERIFIER">;
|
|
332
|
+
MISSING_STATE: _$better_auth0.RawError<"MISSING_STATE">;
|
|
333
|
+
MISSING_PKCE: _$better_auth0.RawError<"MISSING_PKCE">;
|
|
330
334
|
};
|
|
331
335
|
};
|
|
332
336
|
//#endregion
|
|
333
|
-
export {
|
|
337
|
+
export { ElectronOptions, ElectronSharedOptions, FetchUserImageResult, electron, fetchUserImage, normalizeUserOutput };
|
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-CceXYJfW.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/preload.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import electron from "electron";
|
|
2
1
|
import { Awaitable } from "@better-auth/core";
|
|
3
2
|
import { User } from "@better-auth/core/db";
|
|
4
3
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
5
4
|
import * as z from "zod";
|
|
6
|
-
import "better-auth";
|
|
7
5
|
//#region src/types/options.d.ts
|
|
8
6
|
interface ElectronSharedOptions {
|
|
9
7
|
/**
|
package/dist/preload.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import electron, { contextBridge } from "electron";
|
|
2
|
-
//#region ../../node_modules/.pnpm/better-call@1.
|
|
2
|
+
//#region ../../node_modules/.pnpm/better-call@1.4.0_zod@4.3.6/node_modules/better-call/dist/error.mjs
|
|
3
3
|
function isErrorStackTraceLimitWritable() {
|
|
4
4
|
const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
5
5
|
if (desc === void 0) return Object.isExtensible(Error);
|
|
@@ -96,6 +96,10 @@ const statusCodes = {
|
|
|
96
96
|
NETWORK_AUTHENTICATION_REQUIRED: 511
|
|
97
97
|
};
|
|
98
98
|
var InternalAPIError = class extends Error {
|
|
99
|
+
status;
|
|
100
|
+
body;
|
|
101
|
+
headers;
|
|
102
|
+
statusCode;
|
|
99
103
|
constructor(status = "INTERNAL_SERVER_ERROR", body = void 0, headers = {}, statusCode = typeof status === "number" ? status : statusCodes[status]) {
|
|
100
104
|
super(body?.message, body?.cause ? { cause: body.cause } : void 0);
|
|
101
105
|
this.status = status;
|
package/dist/proxy.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { l as ElectronProxyClientOptions } from "./client-
|
|
1
|
+
import { l as ElectronProxyClientOptions } from "./client-BLUnuwWr.mjs";
|
|
2
2
|
import { electron } from "./index.mjs";
|
|
3
|
+
|
|
3
4
|
//#region src/proxy.d.ts
|
|
4
5
|
declare const electronProxyClient: (options: ElectronProxyClientOptions) => {
|
|
5
6
|
id: "electron-proxy";
|
package/dist/proxy.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
2
|
-
import { r as parseProtocolScheme } from "./utils-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-CceXYJfW.mjs";
|
|
2
|
+
import { r as parseProtocolScheme } from "./utils-DxDKRT6e.mjs";
|
|
3
3
|
import { parseCookies } from "better-auth/cookies";
|
|
4
4
|
//#region src/proxy.ts
|
|
5
5
|
const electronProxyClient = (options) => {
|
package/dist/storage.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { d as Storage } from "./client-
|
|
1
|
+
import { d as Storage } from "./client-BLUnuwWr.mjs";
|
|
2
2
|
import { Options } from "conf";
|
|
3
|
+
|
|
3
4
|
//#region src/storage.d.ts
|
|
4
5
|
declare const storage: (opts?: Options<Record<string, any>> | undefined) => Storage;
|
|
5
6
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/electron",
|
|
3
|
-
"version": "1.7.0-rc.
|
|
3
|
+
"version": "1.7.0-rc.6",
|
|
4
4
|
"description": "Better Auth integration for Electron applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,18 +79,18 @@
|
|
|
79
79
|
"@types/better-sqlite3": "^7.6.13",
|
|
80
80
|
"better-sqlite3": "^12.11.1",
|
|
81
81
|
"electron": "^43.1.1",
|
|
82
|
-
"tsdown": "0.
|
|
83
|
-
"@better-auth/core": "1.7.0-rc.
|
|
84
|
-
"better-auth": "1.7.0-rc.
|
|
82
|
+
"tsdown": "0.21.10",
|
|
83
|
+
"@better-auth/core": "1.7.0-rc.6",
|
|
84
|
+
"better-auth": "1.7.0-rc.6"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@better-auth/utils": "0.4.2",
|
|
88
88
|
"@better-fetch/fetch": "1.3.1",
|
|
89
|
-
"better-call": "1.
|
|
89
|
+
"better-call": "1.4.0",
|
|
90
90
|
"conf": "^15.0.2",
|
|
91
91
|
"electron": ">=36.0.0",
|
|
92
|
-
"@better-auth/core": "^1.7.0-rc.
|
|
93
|
-
"better-auth": "^1.7.0-rc.
|
|
92
|
+
"@better-auth/core": "^1.7.0-rc.6",
|
|
93
|
+
"better-auth": "^1.7.0-rc.6"
|
|
94
94
|
},
|
|
95
95
|
"peerDependenciesMeta": {
|
|
96
96
|
"electron": {
|
|
File without changes
|