@payez/next-mvp 3.8.1 → 3.8.2

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.
@@ -33,6 +33,7 @@ export declare function buildBetterAuthProviders(config: IDPClientConfig): Recor
33
33
  export declare function createBetterAuthInstance(idpConfig: IDPClientConfig): import("better-auth").Auth<{
34
34
  secret: string;
35
35
  socialProviders: Record<string, BetterAuthSocialProvider>;
36
+ trustedOrigins: string[];
36
37
  session: {
37
38
  cookieCache: {
38
39
  enabled: true;
@@ -48,6 +48,14 @@ function createBetterAuthInstance(idpConfig) {
48
48
  return (0, better_auth_1.betterAuth)({
49
49
  secret: idpConfig.nextAuthSecret,
50
50
  socialProviders: buildBetterAuthProviders(idpConfig),
51
+ // Trust the app's own origin + any configured base URL
52
+ trustedOrigins: [
53
+ ...(idpConfig.baseClientUrl ? [idpConfig.baseClientUrl] : []),
54
+ ...(process.env.BETTER_AUTH_URL ? [process.env.BETTER_AUTH_URL] : []),
55
+ 'http://localhost:3000',
56
+ 'http://localhost:3400',
57
+ 'http://localhost:3600',
58
+ ],
51
59
  // No database — stateless mode. Better Auth defaults to JWE cookie cache.
52
60
  // Session cookie cache with refreshCache for DB-less setup.
53
61
  session: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payez/next-mvp",
3
- "version": "3.8.1",
3
+ "version": "3.8.2",
4
4
  "sideEffects": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -60,6 +60,15 @@ export function createBetterAuthInstance(idpConfig: IDPClientConfig) {
60
60
 
61
61
  socialProviders: buildBetterAuthProviders(idpConfig),
62
62
 
63
+ // Trust the app's own origin + any configured base URL
64
+ trustedOrigins: [
65
+ ...(idpConfig.baseClientUrl ? [idpConfig.baseClientUrl] : []),
66
+ ...(process.env.BETTER_AUTH_URL ? [process.env.BETTER_AUTH_URL] : []),
67
+ 'http://localhost:3000',
68
+ 'http://localhost:3400',
69
+ 'http://localhost:3600',
70
+ ],
71
+
63
72
  // No database — stateless mode. Better Auth defaults to JWE cookie cache.
64
73
  // Session cookie cache with refreshCache for DB-less setup.
65
74
  session: {