Rocket.Chat Version: 0.56.0
Running Instances: 1
DB Replicaset OpLog: Enabled
Node Version: 4.8.1
The CAS redirection URL is built from SSO Login URL by adding a ?service=.... This breaks when SSO Login URL already has a parameter (in my case the URL is https://example.com/cas/login?gateway=true).
The postfixing function should check whether no parameters exist in the base URL.