Merge pull request #17060 from overleaf/jel-password-linked-group-sso

[web] Prevent updating password for managed users linked to group SSO

GitOrigin-RevId: f40bba47575cfac1b1e42d3138112c0db4f7865c
This commit is contained in:
Jessica Lawshe
2024-02-20 09:06:06 +00:00
committed by Copybot
parent d5639794c2
commit f8094bbdb6
5 changed files with 34 additions and 2 deletions
@@ -1536,6 +1536,7 @@
"you_are_on_x_plan_as_member_of_group_subscription_y_administered_by_z": "",
"you_can_now_enable_sso": "",
"you_can_now_log_in_sso": "",
"you_cant_add_or_change_password_due_to_sso": "",
"you_dont_have_any_repositories": "",
"you_have_added_x_of_group_size_y": "",
"you_have_been_invited_to_transfer_management_of_your_account": "",
@@ -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