@better-auth/expo 1.4.0-beta.13 → 1.4.0-beta.15
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.cjs +2 -2
- package/dist/client.d.cts +12 -12
- package/dist/client.d.ts +12 -12
- package/dist/client.js +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +9 -8
- package/dist/index.js +4 -3
- package/package.json +5 -5
package/dist/client.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
let expo_constants = require("expo-constants");
|
|
3
|
+
expo_constants = require_chunk.__toESM(expo_constants);
|
|
2
4
|
let expo_linking = require("expo-linking");
|
|
3
5
|
expo_linking = require_chunk.__toESM(expo_linking);
|
|
4
6
|
let react_native = require("react-native");
|
|
5
7
|
react_native = require_chunk.__toESM(react_native);
|
|
6
|
-
let expo_constants = require("expo-constants");
|
|
7
|
-
expo_constants = require_chunk.__toESM(expo_constants);
|
|
8
8
|
|
|
9
9
|
//#region src/client.ts
|
|
10
10
|
function parseSetCookieHeader(header) {
|
package/dist/client.d.cts
CHANGED
|
@@ -5,17 +5,17 @@ import { ClientStore } from "@better-auth/core";
|
|
|
5
5
|
//#region src/client.d.ts
|
|
6
6
|
interface CookieAttributes {
|
|
7
7
|
value: string;
|
|
8
|
-
expires?: Date;
|
|
9
|
-
"max-age"?: number;
|
|
10
|
-
domain?: string;
|
|
11
|
-
path?: string;
|
|
12
|
-
secure?: boolean;
|
|
13
|
-
httpOnly?: boolean;
|
|
14
|
-
sameSite?: "Strict" | "Lax" | "None";
|
|
8
|
+
expires?: Date | undefined;
|
|
9
|
+
"max-age"?: number | undefined;
|
|
10
|
+
domain?: string | undefined;
|
|
11
|
+
path?: string | undefined;
|
|
12
|
+
secure?: boolean | undefined;
|
|
13
|
+
httpOnly?: boolean | undefined;
|
|
14
|
+
sameSite?: ("Strict" | "Lax" | "None") | undefined;
|
|
15
15
|
}
|
|
16
16
|
declare function parseSetCookieHeader(header: string): Map<string, CookieAttributes>;
|
|
17
17
|
interface ExpoClientOptions {
|
|
18
|
-
scheme?: string;
|
|
18
|
+
scheme?: string | undefined;
|
|
19
19
|
storage: {
|
|
20
20
|
setItem: (key: string, value: string) => any;
|
|
21
21
|
getItem: (key: string) => string | null;
|
|
@@ -24,17 +24,17 @@ interface ExpoClientOptions {
|
|
|
24
24
|
* Prefix for local storage keys (e.g., "my-app_cookie", "my-app_session_data")
|
|
25
25
|
* @default "better-auth"
|
|
26
26
|
*/
|
|
27
|
-
storagePrefix?: string;
|
|
27
|
+
storagePrefix?: string | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Prefix for server cookie names to filter (e.g., "better-auth.session_token")
|
|
30
30
|
* This is used to identify which cookies belong to better-auth to prevent
|
|
31
31
|
* infinite refetching when third-party cookies are set.
|
|
32
32
|
* @default "better-auth"
|
|
33
33
|
*/
|
|
34
|
-
cookiePrefix?: string;
|
|
35
|
-
disableCache?: boolean;
|
|
34
|
+
cookiePrefix?: string | undefined;
|
|
35
|
+
disableCache?: boolean | undefined;
|
|
36
36
|
}
|
|
37
|
-
declare function getSetCookie(header: string, prevCookie?: string): string;
|
|
37
|
+
declare function getSetCookie(header: string, prevCookie?: string | undefined): string;
|
|
38
38
|
declare function getCookie(cookie: string): string;
|
|
39
39
|
/**
|
|
40
40
|
* Check if the Set-Cookie header contains session-related better-auth cookies.
|
package/dist/client.d.ts
CHANGED
|
@@ -5,17 +5,17 @@ import { ClientStore } from "@better-auth/core";
|
|
|
5
5
|
//#region src/client.d.ts
|
|
6
6
|
interface CookieAttributes {
|
|
7
7
|
value: string;
|
|
8
|
-
expires?: Date;
|
|
9
|
-
"max-age"?: number;
|
|
10
|
-
domain?: string;
|
|
11
|
-
path?: string;
|
|
12
|
-
secure?: boolean;
|
|
13
|
-
httpOnly?: boolean;
|
|
14
|
-
sameSite?: "Strict" | "Lax" | "None";
|
|
8
|
+
expires?: Date | undefined;
|
|
9
|
+
"max-age"?: number | undefined;
|
|
10
|
+
domain?: string | undefined;
|
|
11
|
+
path?: string | undefined;
|
|
12
|
+
secure?: boolean | undefined;
|
|
13
|
+
httpOnly?: boolean | undefined;
|
|
14
|
+
sameSite?: ("Strict" | "Lax" | "None") | undefined;
|
|
15
15
|
}
|
|
16
16
|
declare function parseSetCookieHeader(header: string): Map<string, CookieAttributes>;
|
|
17
17
|
interface ExpoClientOptions {
|
|
18
|
-
scheme?: string;
|
|
18
|
+
scheme?: string | undefined;
|
|
19
19
|
storage: {
|
|
20
20
|
setItem: (key: string, value: string) => any;
|
|
21
21
|
getItem: (key: string) => string | null;
|
|
@@ -24,17 +24,17 @@ interface ExpoClientOptions {
|
|
|
24
24
|
* Prefix for local storage keys (e.g., "my-app_cookie", "my-app_session_data")
|
|
25
25
|
* @default "better-auth"
|
|
26
26
|
*/
|
|
27
|
-
storagePrefix?: string;
|
|
27
|
+
storagePrefix?: string | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Prefix for server cookie names to filter (e.g., "better-auth.session_token")
|
|
30
30
|
* This is used to identify which cookies belong to better-auth to prevent
|
|
31
31
|
* infinite refetching when third-party cookies are set.
|
|
32
32
|
* @default "better-auth"
|
|
33
33
|
*/
|
|
34
|
-
cookiePrefix?: string;
|
|
35
|
-
disableCache?: boolean;
|
|
34
|
+
cookiePrefix?: string | undefined;
|
|
35
|
+
disableCache?: boolean | undefined;
|
|
36
36
|
}
|
|
37
|
-
declare function getSetCookie(header: string, prevCookie?: string): string;
|
|
37
|
+
declare function getSetCookie(header: string, prevCookie?: string | undefined): string;
|
|
38
38
|
declare function getCookie(cookie: string): string;
|
|
39
39
|
/**
|
|
40
40
|
* Check if the Set-Cookie header contains session-related better-auth cookies.
|
package/dist/client.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
2
|
let __better_auth_core_api = require("@better-auth/core/api");
|
|
3
3
|
__better_auth_core_api = require_chunk.__toESM(__better_auth_core_api);
|
|
4
|
-
let zod = require("zod");
|
|
5
|
-
zod = require_chunk.__toESM(zod);
|
|
6
4
|
let better_call = require("better-call");
|
|
7
5
|
better_call = require_chunk.__toESM(better_call);
|
|
6
|
+
let zod = require("zod");
|
|
7
|
+
zod = require_chunk.__toESM(zod);
|
|
8
8
|
|
|
9
9
|
//#region src/index.ts
|
|
10
10
|
const expo = (options) => {
|
|
@@ -14,9 +14,10 @@ const expo = (options) => {
|
|
|
14
14
|
return { options: { trustedOrigins: process.env.NODE_ENV === "development" ? ["exp://"] : [] } };
|
|
15
15
|
},
|
|
16
16
|
async onRequest(request, ctx) {
|
|
17
|
-
if (
|
|
17
|
+
if (options?.disableOriginOverride || request.headers.get("origin")) return;
|
|
18
18
|
/**
|
|
19
|
-
* To bypass origin check from expo, we need to set the origin
|
|
19
|
+
* To bypass origin check from expo, we need to set the origin
|
|
20
|
+
* header to the expo-origin header
|
|
20
21
|
*/
|
|
21
22
|
const expoOrigin = request.headers.get("expo-origin");
|
|
22
23
|
if (!expoOrigin) return;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_auth0 from "better-auth";
|
|
2
2
|
import * as better_call0 from "better-call";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
interface ExpoOptions {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Disable origin override for expo API routes
|
|
9
|
+
* When set to true, the origin header will not be overridden for expo API routes
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
disableOriginOverride?: boolean | undefined;
|
|
11
12
|
}
|
|
12
|
-
declare const expo: (options?: ExpoOptions) => {
|
|
13
|
+
declare const expo: (options?: ExpoOptions | undefined) => {
|
|
13
14
|
id: "expo";
|
|
14
|
-
init: (ctx:
|
|
15
|
+
init: (ctx: better_auth0.AuthContext) => {
|
|
15
16
|
options: {
|
|
16
17
|
trustedOrigins: string[];
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
|
-
onRequest(request: Request, ctx:
|
|
20
|
+
onRequest(request: Request, ctx: better_auth0.AuthContext): Promise<{
|
|
20
21
|
request: Request;
|
|
21
22
|
} | undefined>;
|
|
22
23
|
hooks: {
|
|
23
24
|
after: {
|
|
24
|
-
matcher(context:
|
|
25
|
+
matcher(context: better_auth0.HookEndpointContext): boolean;
|
|
25
26
|
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
|
|
26
27
|
}[];
|
|
27
28
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as better_call0 from "better-call";
|
|
3
|
-
import
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import * as better_auth0 from "better-auth";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
interface ExpoOptions {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Disable origin override for expo API routes
|
|
9
|
+
* When set to true, the origin header will not be overridden for expo API routes
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
disableOriginOverride?: boolean | undefined;
|
|
11
12
|
}
|
|
12
|
-
declare const expo: (options?: ExpoOptions) => {
|
|
13
|
+
declare const expo: (options?: ExpoOptions | undefined) => {
|
|
13
14
|
id: "expo";
|
|
14
|
-
init: (ctx:
|
|
15
|
+
init: (ctx: better_auth0.AuthContext) => {
|
|
15
16
|
options: {
|
|
16
17
|
trustedOrigins: string[];
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
|
-
onRequest(request: Request, ctx:
|
|
20
|
+
onRequest(request: Request, ctx: better_auth0.AuthContext): Promise<{
|
|
20
21
|
request: Request;
|
|
21
22
|
} | undefined>;
|
|
22
23
|
hooks: {
|
|
23
24
|
after: {
|
|
24
|
-
matcher(context:
|
|
25
|
+
matcher(context: better_auth0.HookEndpointContext): boolean;
|
|
25
26
|
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
|
|
26
27
|
}[];
|
|
27
28
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAuthEndpoint, createAuthMiddleware } from "@better-auth/core/api";
|
|
2
|
-
import { z } from "zod";
|
|
3
2
|
import { APIError } from "better-call";
|
|
3
|
+
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/index.ts
|
|
6
6
|
const expo = (options) => {
|
|
@@ -10,9 +10,10 @@ const expo = (options) => {
|
|
|
10
10
|
return { options: { trustedOrigins: process.env.NODE_ENV === "development" ? ["exp://"] : [] } };
|
|
11
11
|
},
|
|
12
12
|
async onRequest(request, ctx) {
|
|
13
|
-
if (
|
|
13
|
+
if (options?.disableOriginOverride || request.headers.get("origin")) return;
|
|
14
14
|
/**
|
|
15
|
-
* To bypass origin check from expo, we need to set the origin
|
|
15
|
+
* To bypass origin check from expo, we need to set the origin
|
|
16
|
+
* header to the expo-origin header
|
|
16
17
|
*/
|
|
17
18
|
const expoOrigin = request.headers.get("expo-origin");
|
|
18
19
|
if (!expoOrigin) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/expo",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Better Auth integration for Expo and React Native applications.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"expo-secure-store": "~14.2.3",
|
|
57
57
|
"expo-web-browser": "~14.2.0",
|
|
58
58
|
"react-native": "~0.80.2",
|
|
59
|
-
"tsdown": "^0.15.
|
|
60
|
-
"@better-auth/core": "1.4.0-beta.
|
|
61
|
-
"better-auth": "1.4.0-beta.
|
|
59
|
+
"tsdown": "^0.15.11",
|
|
60
|
+
"@better-auth/core": "1.4.0-beta.15",
|
|
61
|
+
"better-auth": "1.4.0-beta.15"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"expo-constants": ">=17.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"expo-linking": ">=7.0.0",
|
|
67
67
|
"expo-secure-store": ">=14.0.0",
|
|
68
68
|
"expo-web-browser": ">=14.0.0",
|
|
69
|
-
"@better-auth/core": "1.4.0-beta.
|
|
69
|
+
"@better-auth/core": "1.4.0-beta.15"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@better-fetch/fetch": "1.1.18",
|