mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-31 03:16:42 -05:00
chore: bump expo deps (#8250)
This commit is contained in:
@@ -18,10 +18,6 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
|
||||
bundler: "metro",
|
||||
output: "server",
|
||||
},
|
||||
updates: {
|
||||
fallbackToCacheTimeout: 0,
|
||||
},
|
||||
assetBundlePatterns: ["**/*"],
|
||||
ios: {
|
||||
bundleIdentifier: "your.bundle.identifier",
|
||||
supportsTablet: true,
|
||||
|
||||
@@ -7,10 +7,6 @@ const config = withMonorepoPaths(
|
||||
withNativeWind(getDefaultConfig(__dirname), { input: "./src/global.css" }),
|
||||
);
|
||||
|
||||
// XXX: Resolve our exports in workspace packages
|
||||
// https://github.com/expo/expo/issues/26926
|
||||
config.resolver.unstable_enablePackageExports = true;
|
||||
|
||||
module.exports = config;
|
||||
|
||||
/**
|
||||
@@ -26,7 +22,7 @@ function withMonorepoPaths(config) {
|
||||
const workspaceRoot = path.resolve(projectRoot, "../..");
|
||||
|
||||
// #1 - Watch all files in the monorepo
|
||||
config.watchFolders = [workspaceRoot];
|
||||
config.watchFolders = [...(config.watchFolders ?? []), workspaceRoot];
|
||||
|
||||
// #2 - Resolve modules within the project's `node_modules` first, then all monorepo modules
|
||||
config.resolver.nodeModulesPaths = [
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@better-auth/expo": "workspace:*",
|
||||
"@expo/metro-runtime": "^6.1.2",
|
||||
"@expo/metro-runtime": "^55.0.6",
|
||||
"@expo/vector-icons": "^15.1.1",
|
||||
"@nanostores/react": "^1.0.0",
|
||||
"@react-native-async-storage/async-storage": "2.2.0",
|
||||
"@react-navigation/native": "^7.1.31",
|
||||
"@react-navigation/native": "^7.1.8",
|
||||
"@rn-primitives/avatar": "^1.2.0",
|
||||
"@rn-primitives/separator": "^1.2.0",
|
||||
"@rn-primitives/slot": "^1.2.0",
|
||||
@@ -28,31 +28,31 @@
|
||||
"better-sqlite3": "^12.6.2",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"expo": "~54.0.33",
|
||||
"expo-constants": "~18.0.13",
|
||||
"expo-crypto": "^15.0.8",
|
||||
"expo-font": "~14.0.11",
|
||||
"expo-linking": "~8.0.11",
|
||||
"expo-router": "~6.0.23",
|
||||
"expo-secure-store": "~15.0.8",
|
||||
"expo-splash-screen": "~31.0.13",
|
||||
"expo-status-bar": "~3.0.9",
|
||||
"expo-system-ui": "~6.0.9",
|
||||
"expo-web-browser": "~15.0.10",
|
||||
"expo": "~55.0.4",
|
||||
"expo-constants": "~55.0.7",
|
||||
"expo-crypto": "^55.0.8",
|
||||
"expo-font": "~55.0.4",
|
||||
"expo-linking": "~55.0.7",
|
||||
"expo-router": "~55.0.3",
|
||||
"expo-secure-store": "~55.0.8",
|
||||
"expo-splash-screen": "~55.0.10",
|
||||
"expo-status-bar": "~55.0.4",
|
||||
"expo-system-ui": "~55.0.9",
|
||||
"expo-web-browser": "~55.0.9",
|
||||
"nanostores": "^1.1.1",
|
||||
"nativewind": "^4.2.2",
|
||||
"pg": "^8.19.0",
|
||||
"react": "^19.2.4",
|
||||
"react-dom": "^19.2.4",
|
||||
"react-native": "~0.81.6",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-native": "~0.83.2",
|
||||
"react-native-css-interop": "^0.2.2",
|
||||
"react-native-gesture-handler": "~2.28.0",
|
||||
"react-native-reanimated": "~4.1.6",
|
||||
"react-native-gesture-handler": "~2.30.0",
|
||||
"react-native-reanimated": "~4.2.1",
|
||||
"react-native-safe-area-context": "5.6.2",
|
||||
"react-native-screens": "4.16.0",
|
||||
"react-native-screens": "4.23.0",
|
||||
"react-native-svg": "^15.15.3",
|
||||
"react-native-web": "~0.21.2",
|
||||
"react-native-worklets": "^0.5.2",
|
||||
"react-native-worklets": "^0.7.2",
|
||||
"tailwind-merge": "^3.5.0",
|
||||
"tailwindcss": "^3.4.19"
|
||||
},
|
||||
|
||||
@@ -1,49 +1,6 @@
|
||||
import { getHost, getOrigin, getProtocol } from "../utils/url";
|
||||
import { wildcardMatch } from "../utils/wildcard";
|
||||
|
||||
/**
|
||||
* Matches a hostname against a host pattern.
|
||||
* Supports wildcard patterns like `*.vercel.app` or `preview-*.myapp.com`.
|
||||
*
|
||||
* @param host The hostname to test (e.g., "myapp.com", "preview-123.vercel.app")
|
||||
* @param pattern The host pattern (e.g., "myapp.com", "*.vercel.app")
|
||||
* @returns {boolean} true if the host matches the pattern, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* matchesHostPattern("myapp.com", "myapp.com") // true
|
||||
* matchesHostPattern("preview-123.vercel.app", "*.vercel.app") // true
|
||||
* matchesHostPattern("preview-123.myapp.com", "preview-*.myapp.com") // true
|
||||
* matchesHostPattern("evil.com", "myapp.com") // false
|
||||
* ```
|
||||
*/
|
||||
export const matchesHostPattern = (host: string, pattern: string): boolean => {
|
||||
if (!host || !pattern) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Normalize: remove protocol if accidentally included, lowercase for case-insensitive matching
|
||||
const normalizedHost = host
|
||||
.replace(/^https?:\/\//, "")
|
||||
.split("/")[0]!
|
||||
.toLowerCase();
|
||||
const normalizedPattern = pattern
|
||||
.replace(/^https?:\/\//, "")
|
||||
.split("/")[0]!
|
||||
.toLowerCase();
|
||||
|
||||
// Check if pattern contains wildcard characters
|
||||
const hasWildcard =
|
||||
normalizedPattern.includes("*") || normalizedPattern.includes("?");
|
||||
|
||||
if (hasWildcard) {
|
||||
return wildcardMatch(normalizedPattern)(normalizedHost);
|
||||
}
|
||||
|
||||
// Exact match (case-insensitive for hostnames)
|
||||
return normalizedHost.toLowerCase() === normalizedPattern.toLowerCase();
|
||||
};
|
||||
|
||||
/**
|
||||
* Matches the given url against an origin or origin pattern
|
||||
* See "options.trustedOrigins" for details of supported patterns
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { DynamicBaseURLConfig } from "@better-auth/core";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { matchesHostPattern } from "../auth/trusted-origins";
|
||||
import {
|
||||
getBaseURL,
|
||||
getHostFromRequest,
|
||||
getProtocolFromRequest,
|
||||
isDynamicBaseURLConfig,
|
||||
matchesHostPattern,
|
||||
resolveBaseURL,
|
||||
resolveDynamicBaseURL,
|
||||
} from "./url";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { BaseURLConfig, DynamicBaseURLConfig } from "@better-auth/core";
|
||||
import { env } from "@better-auth/core/env";
|
||||
import { BetterAuthError } from "@better-auth/core/error";
|
||||
import { matchesHostPattern } from "../auth/trusted-origins";
|
||||
import { wildcardMatch } from "./wildcard";
|
||||
|
||||
function checkHasPath(url: string): boolean {
|
||||
try {
|
||||
@@ -259,6 +259,49 @@ export function getProtocolFromRequest(
|
||||
return "https";
|
||||
}
|
||||
|
||||
/**
|
||||
* Matches a hostname against a host pattern.
|
||||
* Supports wildcard patterns like `*.vercel.app` or `preview-*.myapp.com`.
|
||||
*
|
||||
* @param host The hostname to test (e.g., "myapp.com", "preview-123.vercel.app")
|
||||
* @param pattern The host pattern (e.g., "myapp.com", "*.vercel.app")
|
||||
* @returns {boolean} true if the host matches the pattern, false otherwise.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* matchesHostPattern("myapp.com", "myapp.com") // true
|
||||
* matchesHostPattern("preview-123.vercel.app", "*.vercel.app") // true
|
||||
* matchesHostPattern("preview-123.myapp.com", "preview-*.myapp.com") // true
|
||||
* matchesHostPattern("evil.com", "myapp.com") // false
|
||||
* ```
|
||||
*/
|
||||
export const matchesHostPattern = (host: string, pattern: string): boolean => {
|
||||
if (!host || !pattern) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Normalize: remove protocol if accidentally included, lowercase for case-insensitive matching
|
||||
const normalizedHost = host
|
||||
.replace(/^https?:\/\//, "")
|
||||
.split("/")[0]!
|
||||
.toLowerCase();
|
||||
const normalizedPattern = pattern
|
||||
.replace(/^https?:\/\//, "")
|
||||
.split("/")[0]!
|
||||
.toLowerCase();
|
||||
|
||||
// Check if pattern contains wildcard characters
|
||||
const hasWildcard =
|
||||
normalizedPattern.includes("*") || normalizedPattern.includes("?");
|
||||
|
||||
if (hasWildcard) {
|
||||
return wildcardMatch(normalizedPattern)(normalizedHost);
|
||||
}
|
||||
|
||||
// Exact match (case-insensitive for hostnames)
|
||||
return normalizedHost.toLowerCase() === normalizedPattern.toLowerCase();
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolves the base URL from a dynamic config based on the incoming request.
|
||||
* Validates the derived host against the allowedHosts allowlist.
|
||||
|
||||
2343
pnpm-lock.yaml
generated
2343
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user