Skip to content

Better-Auth 1.4.8 broken and unusable due to trusted origins #6944

Description

@JE4GLE

To Reproduce

  1. Create backend using Svelte and configure better-auth with trustedOrigins on localhost
  2. Try to signup or do any action with better-auth

Current behavior

error Invalid origin: http://localhost:5173 []
info If it's a valid URL, please add http://localhost:5173 to trustedOrigins in your auth config
 [
  'Current list of trustedOrigins: http://localhost:5173,http://localhost:5173,http://localhost:5174,http://192.168.178.71:5173,http://192.168.178.71:5174'
]

Expected behavior

No error, the requests work.

What version of Better Auth are you using?

1.4.8

System info

The command npx @better-auth/cli info --json produces no output and results in exit code 1.

Which area(s) are affected? (Select all that apply)

Backend, every auth action

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  trustedOrigins: [
    'http://localhost:5173',
    'http://localhost:5174',
    'http://192.168.178.71:5173',
    'http://192.168.178.71:5174'
  ],
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

It didn't work in 1.4.7 or 1.4.6 either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglockedLocked conversations after being closed for 7 days

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions