Matttermost, Inc.

How to Modify Password Reset Link in Login Page

Purpose

The forgot password link on the sign in page uses the default Mattermost email password reset and users would like the password reset link to point to their internal password reset instead or a different link.

Solution

With reference to the code line here, you can consider changing the value of the URL by making the following changes, for example:

Before

        if (usernameSigninEnabled || emailSigninEnabled) {
            loginControls.push(
                <div
                    id='login_forgot'
                    key='forgotPassword'
                    className='form-group'
                >
                    <Link to={'/reset_password'}>
                        <FormattedMessage
                            id='login.forgot'
                            defaultMessage='I forgot my password'
                        />
                    </Link>
                </div>
            );
        }

After

if (usernameSigninEnabled || emailSigninEnabled) {
            loginControls.push(
                <a
                    className='form-group'
                    key='forgotPassword'
                    href={'https://<something>'}
                >
                    <span>
                        <span className='icon'/>
                        <span>
                            <FormattedMessage
                                id='login.forgot'
                                defaultMessage='I forgot my password'
                            />
                        </span>
                    </span>
                </a>
            );
        }