fix: passkey failing on localhost other than 3000 (#103)

This commit is contained in:
Bereket Engida
2024-10-05 23:40:41 +03:00
committed by GitHub
parent 0ccf68ceed
commit b6353336d9
4 changed files with 5 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ import { Checkbox } from "~/components/ui/checkbox";
import { Input } from "~/components/ui/input";
import { Label } from "~/components/ui/label";
import { signIn } from "~/lib/auth-client";
import { PasswordInput } from "./ui/password-input";
export default function SignInCard() {
const [email, setEmail] = useState("");
@@ -58,13 +59,13 @@ export default function SignInCard() {
Forgot your password?
</Link>
</div>
{/* <PasswordInput
<PasswordInput
id="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
autoComplete="password"
placeholder="Password"
/> */}
/>
</div>
<div className="flex items-center gap-2">
<Checkbox

View File

@@ -1,5 +1,4 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,

View File

@@ -1,6 +1,6 @@
{
"name": "better-auth",
"version": "0.3.3-beta.5",
"version": "0.3.3-beta.7",
"description": "The most comprehensive authentication library for TypeScript.",
"type": "module",
"scripts": {

View File

@@ -76,10 +76,7 @@ export const passkey = (options?: PasskeyOptions) => {
const baseURL = process.env.BETTER_AUTH_URL;
const rpID =
options?.rpID ||
baseURL
?.replace("http://", "")
.replace("https://", "")
.replace(":3000", "") ||
baseURL?.replace("http://", "").replace("https://", "").split(":")[0] ||
"localhost";
if (!rpID) {
throw new BetterAuthError(