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:
parent
926b664433
commit
36947e2f47
1 changed files with 8 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue