Skip to content

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

Merged
rodrigok merged 2 commits intoRocketChat:developfrom
wsw70:develop
Jul 14, 2017
Merged

[FIX] Issue #7365: added check for the existence of a parameter in the CAS URL#7471
rodrigok merged 2 commits intoRocketChat:developfrom
wsw70:develop

Conversation

@wsw70
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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