({
mode: "onBlur",
@@ -65,9 +66,11 @@ export function VerifyEmailForm({
const router = useRouter();
- const params = new URLSearchParams({
- userId: userId,
- });
+ const params = new URLSearchParams({});
+
+ if (userId) {
+ params.append("userId", userId);
+ }
if (isInvite) {
params.append("initial", "true");
@@ -128,10 +131,13 @@ export function VerifyEmailForm({
// if auth methods fall trough, we complete to login
const params = new URLSearchParams({
- userId: userId,
initial: "true", // defines that a code is not required and is therefore not shown in the UI
});
+ if (userId) {
+ params.set("userId", userId);
+ }
+
if (organization) {
params.set("organization", organization);
}
@@ -146,50 +152,66 @@ export function VerifyEmailForm({
}
return !authMethods ? (
-
+
+ >
) : (
-
- {!authMethods.includes(AuthenticationMethodType.PASSWORD) &&
- PASSWORD(false, "/password/set?" + params)}
- {!authMethods.includes(AuthenticationMethodType.PASSKEY) &&
- PASSKEYS(false, "/passkeys/set?" + params)}
-
+ <>
+ {t("title")}
+ {t("description")}
+
+
+ {!authMethods.includes(AuthenticationMethodType.PASSWORD) &&
+ PASSWORD(false, "/password/set?" + params)}
+ {!authMethods.includes(AuthenticationMethodType.PASSKEY) &&
+ PASSKEYS(false, "/passkeys/set?" + params)}
+
+ >
);
}