Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Issue #7365: added check for the existence of a parameter in the CAS URL #7471

Merged
merged 2 commits into from
Jul 14, 2017

Conversation

wsw70
Copy link
Contributor

@wsw70 wsw70 commented Jul 11, 2017

@RocketChat/core
Closes #7365

The fix checks whether the URL contains ?, which means that the configured URL already has parameters(s). In that case instead of adding a ?, a & will allow the chaining of parameters.

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2017

CLA assistant check
All committers have signed the CLA.

const loginUrl = `${ login_url }?service=${ appUrl }/_cas/${ credentialToken }`;
// check if the provided CAS URL already has some parameters
if (login_url.split('?').length > 1) {
const loginUrl = `${ login_url }&service=${ appUrl }/_cas/${ credentialToken }`;
Copy link
Contributor

@gdelavald gdelavald Jul 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue here, since const is block scoped it will not exist outside the if/else blocks, so I recommend using a

let loginurl = [else value here]

and then changing it in case the if condition is true.

@RocketChat RocketChat deleted a comment Jul 12, 2017
@RocketChat RocketChat deleted a comment Jul 12, 2017
@rodrigok rodrigok added this to the 0.58.0 milestone Jul 14, 2017
@rodrigok rodrigok merged commit 4c75b84 into RocketChat:develop Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CAS redirection: wrong postfix of the redirection
4 participants