From bbdd5245ff0f96a8aaccce53f559d754447bde37 Mon Sep 17 00:00:00 2001 From: crazylogic03 Date: Thu, 13 Nov 2025 14:46:49 +0530 Subject: [PATCH 1/2] docs(auth): Add clarification note about Google SSO username/email sync behavior --- .../security/user_settings_security.tsx | 121 ++++++++++-------- 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/webapp/channels/src/components/user_settings/security/user_settings_security.tsx b/webapp/channels/src/components/user_settings/security/user_settings_security.tsx index 543f8dc0a25..08d6baf8569 100644 --- a/webapp/channels/src/components/user_settings/security/user_settings_security.tsx +++ b/webapp/channels/src/components/user_settings/security/user_settings_security.tsx @@ -4,15 +4,15 @@ /* eslint-disable max-lines */ import React from 'react'; -import type {IntlShape} from 'react-intl'; -import {FormattedDate, FormattedMessage, FormattedTime, injectIntl} from 'react-intl'; -import {Link} from 'react-router-dom'; +import type { IntlShape } from 'react-intl'; +import { FormattedDate, FormattedMessage, FormattedTime, injectIntl } from 'react-intl'; +import { Link } from 'react-router-dom'; -import type {OAuthApp} from '@mattermost/types/integrations'; -import type {UserProfile} from '@mattermost/types/users'; +import type { OAuthApp } from '@mattermost/types/integrations'; +import type { UserProfile } from '@mattermost/types/users'; -import type {PasswordConfig} from 'mattermost-redux/selectors/entities/general'; -import type {ActionResult} from 'mattermost-redux/types/actions'; +import type { PasswordConfig } from 'mattermost-redux/selectors/entities/general'; +import type { ActionResult } from 'mattermost-redux/types/actions'; import AccessHistoryModal from 'components/access_history_modal'; import ActivityLogModal from 'components/activity_log_modal'; @@ -24,7 +24,7 @@ import Input from 'components/widgets/inputs/input/input'; import icon50 from 'images/icon50x50.png'; import Constants from 'utils/constants'; -import {isValidPassword} from 'utils/password'; +import { isValidPassword } from 'utils/password'; import MfaSection from './mfa_section'; import UserAccessTokenSection from './user_access_token_section'; @@ -111,11 +111,11 @@ export class SecurityTab extends React.PureComponent { loadAuthorizedOAuthApps = async () => { const res = await this.props.actions.getAuthorizedOAuthApps(); if ('data' in res) { - const {data} = res; - this.setState({authorizedApps: data, serverError: null}); + const { data } = res; + this.setState({ authorizedApps: data, serverError: null }); } else if ('error' in res) { - const {error} = res; - this.setState({serverError: error.message}); + const { error } = res; + this.setState({ serverError: error.message }); } }; @@ -128,7 +128,7 @@ export class SecurityTab extends React.PureComponent { return; } - this.setState({savingPassword: true}); + this.setState({ savingPassword: true }); const res = await this.props.actions.updateUserPassword( user.id, @@ -140,7 +140,7 @@ export class SecurityTab extends React.PureComponent { this.props.actions.getMe(); this.setState(this.getDefaultState()); } else if ('error' in res) { - const {error: err} = res; + const { error: err } = res; const state = this.getDefaultState(); if (err.message) { state.serverError = err.message; @@ -156,7 +156,7 @@ export class SecurityTab extends React.PureComponent { return false; } - const {valid, error} = isValidPassword( + const { valid, error } = isValidPassword( this.state.newPassword, this.props.passwordConfig, ); @@ -172,15 +172,15 @@ export class SecurityTab extends React.PureComponent { }; updateCurrentPassword = (e: React.ChangeEvent) => { - this.setState({currentPassword: e.target.value}); + this.setState({ currentPassword: e.target.value }); }; updateNewPassword = (e: React.ChangeEvent) => { - this.setState({newPassword: e.target.value}); + this.setState({ newPassword: e.target.value }); }; updateConfirmPassword = (e: React.ChangeEvent) => { - this.setState({confirmPassword: e.target.value}); + this.setState({ confirmPassword: e.target.value }); }; deauthorizeApp = async (e: React.MouseEvent) => { @@ -193,10 +193,10 @@ export class SecurityTab extends React.PureComponent { const authorizedApps = this.state.authorizedApps.filter((app) => { return app.id !== appId; }); - this.setState({authorizedApps, serverError: null}); + this.setState({ authorizedApps, serverError: null }); } else if ('error' in res) { - const {error} = res; - this.setState({serverError: error.message}); + const { error } = res; + this.setState({ serverError: error.message }); } }; @@ -205,23 +205,23 @@ export class SecurityTab extends React.PureComponent { this.props.updateSection(section); } else { switch (this.props.activeSection) { - case SECTION_MFA: - case SECTION_SIGNIN: - case SECTION_TOKENS: - case SECTION_APPS: - this.setState({ - serverError: null, - }); - break; - case SECTION_PASSWORD: - this.setState({ - currentPassword: '', - newPassword: '', - confirmPassword: '', - serverError: null, - }); - break; - default: + case SECTION_MFA: + case SECTION_SIGNIN: + case SECTION_TOKENS: + case SECTION_APPS: + this.setState({ + serverError: null, + }); + break; + case SECTION_PASSWORD: + this.setState({ + currentPassword: '', + newPassword: '', + confirmPassword: '', + serverError: null, + }); + break; + default: } this.props.updateSection(''); @@ -308,7 +308,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage: 'New Password', })} validate={(value) => { - const {valid, error} = isValidPassword( + const { valid, error } = isValidPassword( value as string, this.props.passwordConfig, ); @@ -590,7 +590,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using GitLab SSO' /> -
+
); } @@ -614,7 +614,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using Google SSO' /> -
+
); } @@ -638,7 +638,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using Entra ID SSO' /> -
+
); } @@ -662,7 +662,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using OpenID SSO' /> -
+
); } @@ -682,7 +682,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using AD/LDAP' /> -
+
); } @@ -706,7 +706,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using SAML SSO' /> -
+
); } @@ -735,7 +735,7 @@ export class SecurityTab extends React.PureComponent { defaultMessage='Switch to Using Email and Password' /> -
+
); } @@ -761,6 +761,15 @@ export class SecurityTab extends React.PureComponent { /> ); + const ssoNote = ( + + + + ); + max = ( { id: 'user.settings.security.method', defaultMessage: 'Sign-in Method', })} - extraInfo={extraInfo} + extraInfo={<>{extraInfo}{ssoNote}} inputs={inputs} serverError={this.state.serverError} updateSection={this.handleUpdateSection} @@ -899,7 +908,7 @@ export class SecurityTab extends React.PureComponent { src={app.icon_url || icon50} /> -
+
); }); @@ -1055,22 +1064,22 @@ export class SecurityTab extends React.PureComponent { /> } /> -
+
{passwordSection} -
+
-
+
{oauthSection} -
+
{tokensSection} -
+
{signInSection} -
-
+
+
{ {this.props.deleteAccountLink && ( <> -

+

Date: Fri, 14 Nov 2025 23:45:21 +0530 Subject: [PATCH 2/2] i18n: Add translation for SSO username sync note --- webapp/channels/src/i18n/en.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index 7e4ab61a495..9fbd3ae752d 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -6500,6 +6500,7 @@ "user.settings.security.switchEmail": "Switch to Using Email and Password", "user.settings.security.switchGitlab": "Switch to Using GitLab SSO", "user.settings.security.switchGoogle": "Switch to Using Google SSO", + "user.settings.security.ssoUsernameSyncNote": "Note: When using Google SSO, changes to your Google username or email do not automatically sync to Mattermost. To update your username, switch temporarily to email/password login, update your username, and then switch back to Google SSO.", "user.settings.security.switchLdap": "Switch to Using AD/LDAP", "user.settings.security.switchOffice365": "Switch to Using Entra ID SSO", "user.settings.security.switchOpenId": "Switch to Using OpenID SSO", @@ -6685,4 +6686,4 @@ "youtube_video.play_button.aria_label": "Play video", "youtube_video.play.aria_label": "Play {videoTitle} on YouTube", "youtube_video.thumbnail.alt_text": "Thumbnail for {videoTitle} on YouTube" -} +} \ No newline at end of file