mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 17:57:33 +00:00
Merge pull request #491 from zitadel/fix-findings
fix(ldap): translations
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { createNewSessionForLDAP } from "@/lib/server/idp";
|
import { createNewSessionForLDAP } from "@/lib/server/idp";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -26,6 +27,8 @@ export function LDAPUsernamePasswordForm({ idpId, link }: Props) {
|
|||||||
mode: "onBlur",
|
mode: "onBlur",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const t = useTranslations("ldap");
|
||||||
|
|
||||||
const [error, setError] = useState<string>("");
|
const [error, setError] = useState<string>("");
|
||||||
|
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
@@ -66,7 +69,7 @@ export function LDAPUsernamePasswordForm({ idpId, link }: Props) {
|
|||||||
type="text"
|
type="text"
|
||||||
autoComplete="username"
|
autoComplete="username"
|
||||||
{...register("loginName", { required: "This field is required" })}
|
{...register("loginName", { required: "This field is required" })}
|
||||||
label="Loginname"
|
label={t("username")}
|
||||||
data-testid="username-text-input"
|
data-testid="username-text-input"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -75,7 +78,7 @@ export function LDAPUsernamePasswordForm({ idpId, link }: Props) {
|
|||||||
type="password"
|
type="password"
|
||||||
autoComplete="password"
|
autoComplete="password"
|
||||||
{...register("password", { required: "This field is required" })}
|
{...register("password", { required: "This field is required" })}
|
||||||
label="Password"
|
label={t("password")}
|
||||||
data-testid="password-text-input"
|
data-testid="password-text-input"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,7 +101,7 @@ export function LDAPUsernamePasswordForm({ idpId, link }: Props) {
|
|||||||
data-testid="submit-button"
|
data-testid="submit-button"
|
||||||
>
|
>
|
||||||
{loading && <Spinner className="h-5 w-5 mr-2" />}
|
{loading && <Spinner className="h-5 w-5 mr-2" />}
|
||||||
<Translated i18nKey="verify.submit" namespace="ldap" />
|
<Translated i18nKey="submit" namespace="ldap" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
Reference in New Issue
Block a user