| 
					
				 | 
			
			
				@@ -55,6 +55,22 @@ DrupalSSO = function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return user.roles; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * Update the user information from the Drupal server based on the cookies. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * @param {string} cookies 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  this.updateUser = function (cookies) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Meteor.call('drupal-sso.whoami', cookies, function (err, res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        throw new Meteor.Error('whoami', err); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      _.extend(user, res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      userDep.changed(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    * Parse a cookie blob for value of the relevant session cookie. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    * 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -75,9 +91,23 @@ DrupalSSO = function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return cookieValue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  // Constructor body. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * Initialize the server-only part of the SSO settings. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * This method needs to be invoked on the server-side SSO instance: it cannot 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * be invoked during construction, because the instance is not yet ready. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   * @param {Object} settings 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  this.initServerState = function (settings) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    that.settings['drupal-sso'] = settings['drupal-sso']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // Constructor body: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // - Merge public settings to instance. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   _.extend(that.settings.client, Meteor.settings.public); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // - Initialize server-dependent state. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   Meteor.call('drupal-sso.initState', function (err, res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       throw new Meteor.Error('init-state', err); 
			 |