mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 18:12:22 +00:00
hostname for localhost
This commit is contained in:
@@ -37,12 +37,18 @@ export async function registerPasskeyLink(
|
||||
sessionToken: sessionCookie.token,
|
||||
});
|
||||
|
||||
const domain = headers().get("host");
|
||||
const host = headers().get("host");
|
||||
|
||||
if (!domain) {
|
||||
if (!host) {
|
||||
throw new Error("Could not get domain");
|
||||
}
|
||||
|
||||
const [hostname, port] = host.split(":");
|
||||
|
||||
if (!hostname) {
|
||||
throw new Error("Could not get hostname");
|
||||
}
|
||||
|
||||
const userId = session?.session?.factors?.user?.id;
|
||||
|
||||
if (!userId) {
|
||||
@@ -60,7 +66,7 @@ export async function registerPasskeyLink(
|
||||
throw new Error("Missing code in response");
|
||||
}
|
||||
|
||||
return registerPasskey(userId, registerLink.code, domain);
|
||||
return registerPasskey(userId, registerLink.code, hostname);
|
||||
}
|
||||
|
||||
export async function verifyPasskey(command: VerifyPasskeyCommand) {
|
||||
|
||||
@@ -75,7 +75,8 @@ export async function updateSession(options: UpdateSessionCommand) {
|
||||
challenges.webAuthN &&
|
||||
!challenges.webAuthN.domain
|
||||
) {
|
||||
challenges.webAuthN.domain = host;
|
||||
const [hostname, port] = host.split(":");
|
||||
challenges.webAuthN.domain = hostname;
|
||||
}
|
||||
|
||||
const recent = await sessionPromise;
|
||||
|
||||
Reference in New Issue
Block a user