Fixed a bug where signup link showed up when signup was disabled (#35769)
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (shard 0) (push) Blocked by required conditions
Server CI / Postgres (shard 1) (push) Blocked by required conditions
Server CI / Postgres (shard 2) (push) Blocked by required conditions
Server CI / Postgres (shard 3) (push) Blocked by required conditions
Server CI / Merge Postgres Test Results (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 0) (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 1) (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 2) (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 3) (push) Blocked by required conditions
Server CI / Merge Postgres FIPS Test Results (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Tools CI / check-style (mattermost-govet) (push) Waiting to run
Tools CI / Test (mattermost-govet) (push) Waiting to run
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Blocked by required conditions
Web App CI / check-external-links (push) Blocked by required conditions
Web App CI / check-types (push) Blocked by required conditions
Web App CI / test (platform) (push) Blocked by required conditions
Web App CI / test (mattermost-redux) (push) Blocked by required conditions
Web App CI / test (channels shard 1/4) (push) Blocked by required conditions
Web App CI / test (channels shard 2/4) (push) Blocked by required conditions
Web App CI / test (channels shard 3/4) (push) Blocked by required conditions
Web App CI / test (channels shard 4/4) (push) Blocked by required conditions
Web App CI / upload-coverage (push) Blocked by required conditions
Web App CI / build (push) Blocked by required conditions

* Fixed a bug where signup link showed up when signup was disabled

* Removed unused component

* fixed test name

* CI

* fixed a test

* fixed a commit

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Harshil Sharma 2026-04-09 10:21:08 +05:30 committed by GitHub
parent fc9d3be368
commit 010aad6308
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 28 additions and 117 deletions

View file

@ -209,12 +209,8 @@ describe('Authentication', () => {
// # Go to front page
cy.visit('/login');
// * Assert that create account button is visible
cy.findByText('Don\'t have an account?', {timeout: TIMEOUTS.ONE_MIN}).should('be.visible').click();
// * Verify redirection to access problem page since account creation is disabled
cy.url().should('include', '/access_problem');
cy.findByText('Contact your workspace admin');
// * Assert that create account button is not visible
cy.findByText('Don\'t have an account?', {timeout: TIMEOUTS.ONE_MIN}).should('not.exist');
// # Go to sign up with email page
cy.visit('/signup_user_complete');

View file

@ -36,8 +36,7 @@ describe('Login page with close server', () => {
// Restore backed up settings
cy.apiAdminLogin().apiUpdateConfig(oldSettings);
});
it('MM-47222 Should verify access problem page can be reached', () => {
cy.findByText('Don\'t have an account?').should('be.visible').click();
cy.findByText('Contact your workspace admin').should('be.visible');
it('MM-47222 Should verify signup link not visible', () => {
cy.findByText('Don\'t have an account?').should('not.exist');
});
});

View file

@ -1,40 +0,0 @@
.header-footer-route .header-footer-route-container {
display: flex;
justify-content: space-between;
}
.AccessProblem {
&__body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
&__title {
display: flex;
align-items: center;
margin: 32px 0 16px 0;
color: var(--portal-denim);
font-family: 'Metropolis';
font-size: 22px;
font-style: normal;
font-weight: 600;
line-height: 28px;
text-align: center;
}
&__description {
display: flex;
max-width: 640px;
align-items: center;
padding: 0 40px;
color: var(--portal-denim);
font-family: 'Open Sans';
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px;
text-align: center;
}
}

View file

@ -1,51 +0,0 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useCallback, useEffect} from 'react';
import {useIntl} from 'react-intl';
import {useHistory} from 'react-router-dom';
import AccessProblemSVG from 'components/common/svg_images_components/access_problem_svg';
import type {CustomizeHeaderType} from 'components/header_footer_route/header_footer_route';
import './access_problem.scss';
type AccessProblemProps = {
onCustomizeHeader?: CustomizeHeaderType;
}
const AccessProblem = ({
onCustomizeHeader,
}: AccessProblemProps) => {
const {formatMessage} = useIntl();
const history = useHistory();
const handleHeaderBackButtonOnClick = useCallback(() => {
history.goBack();
}, [history]);
useEffect(() => {
if (onCustomizeHeader) {
onCustomizeHeader({
onBackButtonClick: handleHeaderBackButtonOnClick,
});
}
}, [onCustomizeHeader, handleHeaderBackButtonOnClick]);
return (
<div className='AccessProblem__body'>
<AccessProblemSVG
width={320}
height={190}
/>
<div className='AccessProblem__title'>
{formatMessage({id: 'login.contact_admin.title', defaultMessage: 'Contact your workspace admin'})}
</div>
<div className='AccessProblem__description'>
{formatMessage({id: 'login.contact_admin.detail', defaultMessage: "To access your team's workspace, contact your workspace admin. If you've been invited already, check your email inbox for a Mattermost workspace invite."})}
</div>
</div>
);
};
export default AccessProblem;

View file

@ -408,6 +408,25 @@ describe('components/login/Login', () => {
expect(history.push).toHaveBeenCalledWith(redirectPath);
});
it('should not show dont have an account when open server is disabled', () => {
const state = mergeObjects(baseState, {
entities: {
general: {
config: {
EnableOpenServer: 'false',
},
},
},
});
renderWithContext(
<Login/>,
state,
);
expect(screen.queryByText('Don\'t have an account')).not.toBeInTheDocument();
});
describe('EnableGuestMagicLink', () => {
it('should show password field when EnableGuestMagicLink is false', async () => {
const state = mergeObjects(baseState, {

View file

@ -437,23 +437,18 @@ const Login = ({onCustomizeHeader}: LoginProps) => {
}, [sessionExpired, formatMessage, onDismissSessionExpired, extraParam, siteName, searchParam]);
const getAlternateLink = useCallback(() => {
if (!showSignup) {
return undefined;
}
const linkLabel = formatMessage({
id: 'login.noAccount',
defaultMessage: 'Don\'t have an account?',
});
if (showSignup) {
return (
<AlternateLinkLayout
className='login-body-alternate-link'
alternateLinkPath={'/signup_user_complete'}
alternateLinkLabel={linkLabel}
/>
);
}
return (
<AlternateLinkLayout
className='login-body-alternate-link'
alternateLinkPath={'/access_problem'}
alternateLinkPath={'/signup_user_complete'}
alternateLinkLabel={linkLabel}
/>
);

View file

@ -50,7 +50,6 @@ const MobileViewWatcher = makeAsyncComponent('MobileViewWatcher', lazy(() => imp
const WindowSizeObserver = makeAsyncComponent('WindowSizeObserver', lazy(() => import('components/window_size_observer/WindowSizeObserver')));
const ErrorPage = makeAsyncComponent('ErrorPage', lazy(() => import('components/error_page')));
const Login = makeAsyncComponent('LoginController', lazy(() => import('components/login/login')));
const AccessProblem = makeAsyncComponent('AccessProblem', lazy(() => import('components/access_problem')));
const PasswordResetSendLink = makeAsyncComponent('PasswordResedSendLink', lazy(() => import('components/password_reset_send_link')));
const PasswordResetForm = makeAsyncComponent('PasswordResetForm', lazy(() => import('components/password_reset_form')));
const Signup = makeAsyncComponent('SignupController', lazy(() => import('components/signup/signup')));
@ -320,10 +319,6 @@ export default class Root extends React.PureComponent<Props, State> {
path={'/login'}
component={Login}
/>
<HFRoute
path={'/access_problem'}
component={AccessProblem}
/>
<HFTRoute
path={'/reset_password'}
component={PasswordResetSendLink}

View file

@ -5143,8 +5143,6 @@
"login.cardtitle": "Log in",
"login.cardtitle.external": "Log in with one of the following:",
"login.changed": "Sign-in method changed successfully",
"login.contact_admin.detail": "To access your team's workspace, contact your workspace admin. If you've been invited already, check your email inbox for a Mattermost workspace invite.",
"login.contact_admin.title": "Contact your workspace admin",
"login.createTeam": "Create a team",
"login.deactivatedUser": "Your account has been deactivated.",
"login.defaultError": "We were unable to log you in. Please enter your details and try again.",