1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

Update Login.jsx

This commit is contained in:
Kacy Luzzardi 2025-04-20 06:21:29 +02:00 committed by GitHub
parent 926b664433
commit 36947e2f47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,7 +124,6 @@ const Login = React.memo(
case 'Invalid credentials':
case 'Invalid email or username':
emailOrUsernameField.current.select();
break;
case 'Invalid password':
setData((prevData) => ({
@ -132,7 +131,6 @@ const Login = React.memo(
password: '',
}));
focusPasswordField();
break;
default:
}
@ -143,6 +141,13 @@ const Login = React.memo(
passwordField.current.focus();
}, [focusPasswordFieldState]);
useEffect(() => {
const params = new URLSearchParams(window.location.search);
if (params.has('enforce_oidc_login')) {
onAuthenticateUsingOidc();
}
}, [onAuthenticateUsingOidc]);
return (
<div className={classNames(styles.wrapper, styles.fullHeight)}>
<Grid verticalAlign="middle" className={styles.fullHeightPaddingFix}>
@ -159,7 +164,6 @@ const Login = React.memo(
<div>
{message && (
<Message
// eslint-disable-next-line react/jsx-props-no-spreading
{...{
[message.type]: true,
}}
@ -250,12 +254,10 @@ const Login = React.memo(
);
Login.propTypes = {
/* eslint-disable react/forbid-prop-types */
defaultData: PropTypes.object.isRequired,
/* eslint-enable react/forbid-prop-types */
isSubmitting: PropTypes.bool.isRequired,
isSubmittingUsingOidc: PropTypes.bool.isRequired,
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
error: PropTypes.object,
withOidc: PropTypes.bool.isRequired,
isOidcEnforced: PropTypes.bool.isRequired,
onAuthenticate: PropTypes.func.isRequired,