|
|
@@ -25,15 +25,33 @@ type PasswordUpdateResult = {
|
|
|
|
|
|
function PasswordSection() {
|
|
|
const { t } = useTranslation()
|
|
|
-
|
|
|
+ const hideChangePassword = getMeta('ol-cannot-change-password') as boolean
|
|
|
return (
|
|
|
<>
|
|
|
<h3>{t('change_password')}</h3>
|
|
|
- <PasswordInnerSection />
|
|
|
+ {hideChangePassword ? (
|
|
|
+ <CanOnlyLogInThroughSSO />
|
|
|
+ ) : (
|
|
|
+ <PasswordInnerSection />
|
|
|
+ )}
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+function CanOnlyLogInThroughSSO() {
|
|
|
+ return (
|
|
|
+ <p>
|
|
|
+ <Trans
|
|
|
+ i18nKey="you_cant_add_or_change_password_due_to_sso"
|
|
|
+ components={[
|
|
|
+ // eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
|
|
|
+ <a href="/learn/how-to/Logging_in_with_Group_single_sign-on" />,
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </p>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
function PasswordInnerSection() {
|
|
|
const { t } = useTranslation()
|
|
|
const { isOverleaf } = getMeta('ol-ExposedSettings') as ExposedSettings
|