mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 12:27:44 +00:00
fix: passkey failing on localhost other than 3000 (#103)
This commit is contained in:
@@ -18,6 +18,7 @@ import { Checkbox } from "~/components/ui/checkbox";
|
|||||||
import { Input } from "~/components/ui/input";
|
import { Input } from "~/components/ui/input";
|
||||||
import { Label } from "~/components/ui/label";
|
import { Label } from "~/components/ui/label";
|
||||||
import { signIn } from "~/lib/auth-client";
|
import { signIn } from "~/lib/auth-client";
|
||||||
|
import { PasswordInput } from "./ui/password-input";
|
||||||
|
|
||||||
export default function SignInCard() {
|
export default function SignInCard() {
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
@@ -58,13 +59,13 @@ export default function SignInCard() {
|
|||||||
Forgot your password?
|
Forgot your password?
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
{/* <PasswordInput
|
<PasswordInput
|
||||||
id="password"
|
id="password"
|
||||||
value={password}
|
value={password}
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
autoComplete="password"
|
autoComplete="password"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
/> */}
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "./.svelte-kit/tsconfig.json",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "better-auth",
|
"name": "better-auth",
|
||||||
"version": "0.3.3-beta.5",
|
"version": "0.3.3-beta.7",
|
||||||
"description": "The most comprehensive authentication library for TypeScript.",
|
"description": "The most comprehensive authentication library for TypeScript.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -76,10 +76,7 @@ export const passkey = (options?: PasskeyOptions) => {
|
|||||||
const baseURL = process.env.BETTER_AUTH_URL;
|
const baseURL = process.env.BETTER_AUTH_URL;
|
||||||
const rpID =
|
const rpID =
|
||||||
options?.rpID ||
|
options?.rpID ||
|
||||||
baseURL
|
baseURL?.replace("http://", "").replace("https://", "").split(":")[0] ||
|
||||||
?.replace("http://", "")
|
|
||||||
.replace("https://", "")
|
|
||||||
.replace(":3000", "") ||
|
|
||||||
"localhost";
|
"localhost";
|
||||||
if (!rpID) {
|
if (!rpID) {
|
||||||
throw new BetterAuthError(
|
throw new BetterAuthError(
|
||||||
|
|||||||
Reference in New Issue
Block a user