Skip to content

Commit

Permalink
CAS: BugFix for service URL when RC running in subdir. Source: #3981
Browse files Browse the repository at this point in the history
  • Loading branch information
corecache committed Oct 2, 2016
1 parent 54b145c commit 8ba82b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/rocketchat-cas/cas_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Meteor.loginWithCas = function(options, callback) {
return;
}

var loginUrl = login_url + '?service=' + Meteor.absoluteUrl('_cas/') + credentialToken;
var appUrl = Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
var loginUrl = login_url + '?service=' + appUrl + '/_cas/' + credentialToken;

var popup = openCenteredPopup(
loginUrl,
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-cas/cas_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ var casTicket = function(req, token, callback) {
var ticketId = parsedUrl.query.ticket;
var baseUrl = RocketChat.settings.get('CAS_base_url');
var cas_version = parseFloat(RocketChat.settings.get('CAS_version'));
var appUrl = Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
logger.debug('Using CAS_base_url: ' + baseUrl);

var cas = new CAS({
base_url: baseUrl,
version: cas_version,
service: Meteor.absoluteUrl() + '_cas/' + token
service: appUrl + '/_cas/' + token
});

cas.validate(ticketId, function(err, status, username, details) {
Expand Down

0 comments on commit 8ba82b1

Please sign in to comment.