mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-15 03:50:11 +01:00
fix: disable email login if ldap is enabled
This commit is contained in:
parent
67a0fc6ea5
commit
d9cfe697d6
@ -80,7 +80,9 @@ const SignInForm = ({ redirectPath }: { redirectPath: string }) => {
|
||||
useState(false);
|
||||
|
||||
const validationSchema = yup.object().shape({
|
||||
emailOrUsername: yup.string().required(t("common.error.field-required")),
|
||||
emailOrUsername: config.get("ldap.enabled")
|
||||
? yup.string().matches(/^[^@]+$/, t("signIn.error.invalid-username"))
|
||||
: yup.string().required(t("common.error.field-required")),
|
||||
password: yup
|
||||
.string()
|
||||
.min(8, t("common.error.too-short", { length: 8 }))
|
||||
@ -172,8 +174,16 @@ const SignInForm = ({ redirectPath }: { redirectPath: string }) => {
|
||||
})}
|
||||
>
|
||||
<TextInput
|
||||
label={t("signin.input.email-or-username")}
|
||||
placeholder={t("signin.input.email-or-username.placeholder")}
|
||||
label={
|
||||
config.get("ldap.enabled")
|
||||
? t("signup.input.username")
|
||||
: t("signin.input.email-or-username")
|
||||
}
|
||||
placeholder={
|
||||
config.get("ldap.enabled")
|
||||
? t("signup.input.username.placeholder")
|
||||
: t("signin.input.email-or-username.placeholder")
|
||||
}
|
||||
{...form.getInputProps("emailOrUsername")}
|
||||
/>
|
||||
<PasswordInput
|
||||
|
@ -50,6 +50,7 @@ export default {
|
||||
"signIn.oauth.microsoft": "Microsoft",
|
||||
"signIn.oauth.discord": "Discord",
|
||||
"signIn.oauth.oidc": "OpenID",
|
||||
"signIn.error.invalid-username": "Invalid username",
|
||||
|
||||
// END /auth/signin
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user