Skip to content

Commit

Permalink
Issue RocketChat#7365: added check for the existence of a parameter i…
Browse files Browse the repository at this point in the history
…n the CAS URL
  • Loading branch information
wsw70 committed Jul 11, 2017
1 parent 5cb30b4 commit 670a8f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/rocketchat-cas/cas_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ Meteor.loginWithCas = function(options, callback) {
}

const appUrl = Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
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 }`;
} else {
const loginUrl = `${ login_url }?service=${ appUrl }/_cas/${ credentialToken }`;
}

const popup = openCenteredPopup(
loginUrl,
Expand Down

0 comments on commit 670a8f4

Please sign in to comment.