both webauthn vars use punycode for internationalized domains

This commit is contained in:
2026-03-22 19:52:21 +02:00
parent d88fd52fbe
commit 9d0294d380
2 changed files with 5 additions and 6 deletions

View File

@@ -103,9 +103,7 @@ export default async function adminTeamRoutes(app: FastifyInstance) {
},
});
const protocol = config.WEBAUTHN_ORIGIN.startsWith("https") ? "https" : "http";
const prettyHost = config.WEBAUTHN_RP_ID || new URL(config.WEBAUTHN_ORIGIN).hostname;
const inviteUrl = `${protocol}://${prettyHost}/admin/join/${token}`;
const inviteUrl = `${config.WEBAUTHN_ORIGIN}/admin/join/${token}`;
reply.status(201).send({ inviteUrl, token, recoveryPhrase, expiresAt });
}
);