-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Cannot connect to server secured with .htaccess #1355
Description
- Your Rocket.Chat Experimental app version: 4.0.2.2087
- Your Rocket.Chat server version: 2.1.0
- Device (or Simulator) you're running with: One Plus 6
Using the current experimental version of the app available in the Play Store I cannot connect to our server, which is behind a login with user password configured via .htaccess.
The URL I enter in the connection part is https://username:[email protected]
The error I get after trying to connect is: The URL you entered is invalid. Check it and try again, please
If I see it right, currently the regular expression for adding a new server does not accept http basic auth to be included in the URL.
| if (/^(https?:\/\/)?(((\w|[0-9-_])+(\.(\w|[0-9-_])+)+)|localhost)(:\d+)?$/.test(url)) { |
The following regular expression
(https?:\/\/)?((.+?):(.+?)@)?(((\w|[0-9-_])+(\.(\w|[0-9-_])+)+)|localhost)(:\d+)?$
is accepting a URL with user and password information (e.g, https://username:[email protected])
Hope this helps