mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 12:27:43 +00:00
fix: passkey rpID default
This commit is contained in:
@@ -66,9 +66,7 @@ export const auth = betterAuth({
|
||||
},
|
||||
},
|
||||
}),
|
||||
passkey({
|
||||
rpID: "localhost",
|
||||
}),
|
||||
passkey(),
|
||||
],
|
||||
socialProvider: [
|
||||
github({
|
||||
|
||||
@@ -72,7 +72,10 @@ export type Passkey = {
|
||||
|
||||
export const passkey = (options?: PasskeyOptions) => {
|
||||
const baseURL = process.env.BETTER_AUTH_URL;
|
||||
const rpID = options?.rpID || baseURL || "localhost";
|
||||
const rpID =
|
||||
options?.rpID ||
|
||||
baseURL?.replace("http://", "").replace("https://", "") ||
|
||||
"localhost";
|
||||
if (!rpID) {
|
||||
throw new BetterAuthError(
|
||||
"passkey rpID not found. Please provide a rpID in the options or set the BETTER_AUTH_URL environment variable.",
|
||||
|
||||
Reference in New Issue
Block a user