element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.01k stars 1.96k forks source link

Options to hide "Create Account", "Lost Password" and Homeserver in the login page #9528

Closed jacotec closed 4 years ago

jacotec commented 5 years ago

I'm running Matrix Servers which are using an OpenLDAP backend via MXISD as ID-Server due to the lack of a proper user management in matrix-synapse. That solution works very well running also PWM as password/profile self-service and new user registration.

It's easy to set an own homepage in config.json and tweak its copy of welcome.html to show buttons for registration, manage account and lost password to point to the respecting pages in PWM.

Unfortunately the login-page which appears after clicking on "Sign in" shows hardcoded links to:

So I need to pimp the "bundle.js" after each update to get rid of these points, which is really ugly.

All this should be able to be disabled in config.json for people running own homeservers with own ID servers and a self-hosted Riot-Web for their chat systems.

turt2live commented 5 years ago

disable_custom_urls should prevent the ability to change the homeserver URL, at the very least.

jacotec commented 4 years ago

Any update here? I still need to patch the bundle.js after each update and it's a bit annoying ...

t3chguy commented 4 years ago

Related https://github.com/vector-im/riot-web/issues/8824

KuenzelIT commented 4 years ago

Hi, we're using a ldap server for our users and we also don't need a "create account" link. Would be nice to be able to hide it in the config.

Metzlmane commented 4 years ago

Same here, leads to confused user questions

un-chein-andalou commented 4 years ago

I ran a PoC today in a large company using ldap auth and had exactly this issue. So many people clicking 'create account' instead of following the instructions given. Really need an easy option to remove this button!

Guilhem-Lalanne commented 4 years ago

Any update here? I still need to patch the bundle.js after each update and it's a bit annoying ...

Hi @jacotec , do you have a repo where I could see what modifications you make each time ? I have the same problem, and modifying the page seems to be a good idea. Thank you :)

jacotec commented 4 years ago

@Guilhem-Lalanne From Riot-Web 1.6 on the changes must be done in "vendors-init.js". Two parts must be removed:

r.a.createElement("a",{className:"mx_AuthBody_changeFlow",onClick:this.onTryRegisterClick,href:"#"},Object(s.a)("Create account")),

and

this.props.onForgotPasswordClick&&(n=r.a.createElement("span",null,Object(s.a)("Not sure of your password? <a>Set a new one</a>",{},{a:e=>r.a.createElement(Me.a,{className:"mx_Login_forgot",disabled:this.props.busy,kind:"link",onClick:this.onForgotPasswordClick},e)})));

Important: The variable names like "a", "r" etc. are always changing 🙄. I'm searching in Notepad++ (Win) or BBEdit (Mac) for "Create Account" and "Not sure of your password" and identify the parts above (with respecting the changed variable names). Then just delete exactly the parts above.

It's a mess ... we really need that as an option in the config.json 😒

Guilhem-Lalanne commented 4 years ago

Thank you for your quick answer ! When I have some time, I'll try to find out how these variables are created. Hopefully I will be able to make a PR, but that's not for tomorrow ^^'

t3chguy commented 4 years ago

Doing it in config.json is likely not desirable, sensing it from the configured server is better.

t3chguy commented 4 years ago

Closing the remainder for https://github.com/vector-im/element-web/issues/15188 which will be resolved shortly