|
@@ -1,7 +1,7 @@
|
|
/**
|
|
/**
|
|
* The SSO constructor.
|
|
* The SSO constructor.
|
|
*
|
|
*
|
|
- * Notice that the returned sso instance has asynchronous behavior: its state
|
|
|
|
|
|
+ * Notice that the returned SSO instance has asynchronous behavior: its state
|
|
* component will only be initialized once the server callback has returned,
|
|
* component will only be initialized once the server callback has returned,
|
|
* which will almost always be some milliseconds after the instance itself is
|
|
* which will almost always be some milliseconds after the instance itself is
|
|
* returned: check sso.state.online to ensure the connection attempts is done:
|
|
* returned: check sso.state.online to ensure the connection attempts is done:
|
|
@@ -9,14 +9,13 @@
|
|
* -> false -> failed, values are defaults,
|
|
* -> false -> failed, values are defaults,
|
|
* -> true -> succeeded,valuers are those provided by the server.
|
|
* -> true -> succeeded,valuers are those provided by the server.
|
|
*
|
|
*
|
|
- * @param {string} document_cookies
|
|
|
|
* @returns {DrupalSSO}
|
|
* @returns {DrupalSSO}
|
|
* @constructor
|
|
* @constructor
|
|
*/
|
|
*/
|
|
-DrupalSSO = function (document_cookies) {
|
|
|
|
|
|
+DrupalSSO = function () {
|
|
// Called without `new`: call with it.
|
|
// Called without `new`: call with it.
|
|
if (!(this instanceof DrupalSSO)) {
|
|
if (!(this instanceof DrupalSSO)) {
|
|
- return new DrupalSSO(document_cookies);
|
|
|
|
|
|
+ return new DrupalSSO();
|
|
}
|
|
}
|
|
|
|
|
|
// Work around "this" interpretation in local scope methods.
|
|
// Work around "this" interpretation in local scope methods.
|
|
@@ -66,7 +65,7 @@ DrupalSSO = function (document_cookies) {
|
|
cookieBlob = '; ' + cookieBlob;
|
|
cookieBlob = '; ' + cookieBlob;
|
|
|
|
|
|
var cookieName = that.state.cookieName;
|
|
var cookieName = that.state.cookieName;
|
|
- var cookieValue = undefined;
|
|
|
|
|
|
+ var cookieValue;
|
|
var cookies = cookieBlob.split('; ' + cookieName + "=");
|
|
var cookies = cookieBlob.split('; ' + cookieName + "=");
|
|
|
|
|
|
if (cookies.length == 2) {
|
|
if (cookies.length == 2) {
|
|
@@ -74,7 +73,7 @@ DrupalSSO = function (document_cookies) {
|
|
}
|
|
}
|
|
|
|
|
|
return cookieValue;
|
|
return cookieValue;
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
// Constructor body.
|
|
// Constructor body.
|
|
_.extend(that.settings.client, Meteor.settings.public);
|
|
_.extend(that.settings.client, Meteor.settings.public);
|