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