mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-02-05 01:38:56 -05:00
fix: disable email login if ldap is enabled
This commit is contained in:
parent
67a0fc6ea5
commit
d9cfe697d6
2 changed files with 14 additions and 3 deletions
|
@ -80,7 +80,9 @@ const SignInForm = ({ redirectPath }: { redirectPath: string }) => {
|
||||||
useState(false);
|
useState(false);
|
||||||
|
|
||||||
const validationSchema = yup.object().shape({
|
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
|
password: yup
|
||||||
.string()
|
.string()
|
||||||
.min(8, t("common.error.too-short", { length: 8 }))
|
.min(8, t("common.error.too-short", { length: 8 }))
|
||||||
|
@ -172,8 +174,16 @@ const SignInForm = ({ redirectPath }: { redirectPath: string }) => {
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
label={t("signin.input.email-or-username")}
|
label={
|
||||||
placeholder={t("signin.input.email-or-username.placeholder")}
|
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")}
|
{...form.getInputProps("emailOrUsername")}
|
||||||
/>
|
/>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
|
|
|
@ -50,6 +50,7 @@ export default {
|
||||||
"signIn.oauth.microsoft": "Microsoft",
|
"signIn.oauth.microsoft": "Microsoft",
|
||||||
"signIn.oauth.discord": "Discord",
|
"signIn.oauth.discord": "Discord",
|
||||||
"signIn.oauth.oidc": "OpenID",
|
"signIn.oauth.oidc": "OpenID",
|
||||||
|
"signIn.error.invalid-username": "Invalid username",
|
||||||
|
|
||||||
// END /auth/signin
|
// END /auth/signin
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue