|
|
|
@ -68,6 +68,7 @@ const Login = React.memo(
|
|
|
|
isSubmittingUsingOidc,
|
|
|
|
isSubmittingUsingOidc,
|
|
|
|
error,
|
|
|
|
error,
|
|
|
|
withOidc,
|
|
|
|
withOidc,
|
|
|
|
|
|
|
|
isOidcEnforced,
|
|
|
|
onAuthenticate,
|
|
|
|
onAuthenticate,
|
|
|
|
onAuthenticateUsingOidc,
|
|
|
|
onAuthenticateUsingOidc,
|
|
|
|
onMessageDismiss,
|
|
|
|
onMessageDismiss,
|
|
|
|
@ -107,8 +108,10 @@ const Login = React.memo(
|
|
|
|
}, [onAuthenticate, data]);
|
|
|
|
}, [onAuthenticate, data]);
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
if (!isOidcEnforced) {
|
|
|
|
emailOrUsernameField.current.focus();
|
|
|
|
emailOrUsernameField.current.focus();
|
|
|
|
}, []);
|
|
|
|
}
|
|
|
|
|
|
|
|
}, [isOidcEnforced]);
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
if (wasSubmitting && !isSubmitting && error) {
|
|
|
|
if (wasSubmitting && !isSubmitting && error) {
|
|
|
|
@ -159,6 +162,7 @@ const Login = React.memo(
|
|
|
|
onDismiss={onMessageDismiss}
|
|
|
|
onDismiss={onMessageDismiss}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
{!isOidcEnforced && (
|
|
|
|
<Form size="large" onSubmit={handleSubmit}>
|
|
|
|
<Form size="large" onSubmit={handleSubmit}>
|
|
|
|
<div className={styles.inputWrapper}>
|
|
|
|
<div className={styles.inputWrapper}>
|
|
|
|
<div className={styles.inputLabel}>{t('common.emailOrUsername')}</div>
|
|
|
|
<div className={styles.inputLabel}>{t('common.emailOrUsername')}</div>
|
|
|
|
@ -195,15 +199,20 @@ const Login = React.memo(
|
|
|
|
disabled={isSubmitting || isSubmittingUsingOidc}
|
|
|
|
disabled={isSubmitting || isSubmittingUsingOidc}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Form>
|
|
|
|
</Form>
|
|
|
|
|
|
|
|
)}
|
|
|
|
{withOidc && (
|
|
|
|
{withOidc && (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="button"
|
|
|
|
type="button"
|
|
|
|
|
|
|
|
fluid={isOidcEnforced}
|
|
|
|
|
|
|
|
primary={isOidcEnforced}
|
|
|
|
|
|
|
|
size={isOidcEnforced ? 'large' : undefined}
|
|
|
|
|
|
|
|
icon={isOidcEnforced ? 'right arrow' : undefined}
|
|
|
|
|
|
|
|
labelPosition={isOidcEnforced ? 'right' : undefined}
|
|
|
|
|
|
|
|
content={t('action.logInWithSSO')}
|
|
|
|
loading={isSubmittingUsingOidc}
|
|
|
|
loading={isSubmittingUsingOidc}
|
|
|
|
disabled={isSubmitting || isSubmittingUsingOidc}
|
|
|
|
disabled={isSubmitting || isSubmittingUsingOidc}
|
|
|
|
onClick={onAuthenticateUsingOidc}
|
|
|
|
onClick={onAuthenticateUsingOidc}
|
|
|
|
>
|
|
|
|
/>
|
|
|
|
{t('action.logInWithSSO')}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -242,6 +251,7 @@ Login.propTypes = {
|
|
|
|
isSubmittingUsingOidc: PropTypes.bool.isRequired,
|
|
|
|
isSubmittingUsingOidc: PropTypes.bool.isRequired,
|
|
|
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
|
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
|
|
withOidc: PropTypes.bool.isRequired,
|
|
|
|
withOidc: PropTypes.bool.isRequired,
|
|
|
|
|
|
|
|
isOidcEnforced: PropTypes.bool.isRequired,
|
|
|
|
onAuthenticate: PropTypes.func.isRequired,
|
|
|
|
onAuthenticate: PropTypes.func.isRequired,
|
|
|
|
onAuthenticateUsingOidc: PropTypes.func.isRequired,
|
|
|
|
onAuthenticateUsingOidc: PropTypes.func.isRequired,
|
|
|
|
onMessageDismiss: PropTypes.func.isRequired,
|
|
|
|
onMessageDismiss: PropTypes.func.isRequired,
|
|
|
|
|