From 4e744aa6666d40ea58da650978af37db36a0a455 Mon Sep 17 00:00:00 2001
From: miker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 3 Sep 2010 21:08:07 +0000
Subject: [PATCH] make the authcookie param (and openils.User.authcookie)
 useful

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17490 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/web/js/dojo/openils/User.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/web/js/dojo/openils/User.js b/Open-ILS/web/js/dojo/openils/User.js
index 24d67569f0..bd91ba878d 100644
--- a/Open-ILS/web/js/dojo/openils/User.js
+++ b/Open-ILS/web/js/dojo/openils/User.js
@@ -24,6 +24,7 @@ if(!dojo._hasResource["openils.User"]) {
     dojo.require('fieldmapper.Fieldmapper');
     dojo.require('fieldmapper.OrgUtils');
     dojo.require('openils.Util');
+    dojo.require('dojo.cookie');
     dojo.requireLocalization("openils.User", "User");
 
     dojo.declare('openils.User', null, {
@@ -51,6 +52,7 @@ if(!dojo._hasResource["openils.User"]) {
             this.authcookie = kwargs.authcookie || openils.User.authcookie;
             this.permOrgStoreCache = {}; /* permName => permOrgUnitStore map */
 
+            if (this.authcookie) this.authtoken = dojo.cookie(this.authcookie);
             if (this.id && this.authtoken) this.user = this.getById( this.id );
             else if (this.authtoken) this.getBySession();
             else if (kwargs.login) this.login();
@@ -148,7 +150,6 @@ if(!dojo._hasResource["openils.User"]) {
 					if (!openils.User.authtime) openils.User.authtime = _u.authtime;
                     _u.getBySession(onComplete);
                     if(_u.authcookie) {
-                        dojo.require('dojo.cookie');
                         dojo.cookie(_u.authcookie, _u.authtoken, {path:'/'});
                     }
                 }
@@ -192,7 +193,6 @@ if(!dojo._hasResource["openils.User"]) {
             if (!openils.User.authtime) openils.User.authtime = _u.authtime;
 
             if(_u.authcookie) {
-                dojo.require('dojo.cookie');
                 dojo.cookie(_u.authcookie, _u.authtoken, {path:'/'});
             }
 
-- 
2.11.0