helps if you use the right parameters
authorAndy Allan <gravitystorm@gmail.com>
Tue, 19 Oct 2010 10:10:34 +0000 (10:10 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 19 Oct 2010 10:10:34 +0000 (10:10 +0000)
net/systemeD/halcyon/connection/XMLConnection.as
net/systemeD/potlatch2/save/SaveManager.as
potlatch2.mxml

index 25b69aa58e3ecd657715d0354be0940f164d58ff..a513d56e6115332e796229fc499633ac637f6b81 100644 (file)
@@ -61,7 +61,8 @@ package net.systemeD.halcyon.connection {
         }
 
         override public function setAccessToken(key:String, secret:String):void {
-            if(key && secret) {
+            trace("setAccessToken "+key+" "+secret);
+            if (key && secret) {
               authToken = new OAuthToken(key, secret);
             }
         }
index c488956df398265155331fba43fba8b0d14d675d..bb885e503a32912f66318968dbbc3aaebfd13bd8 100644 (file)
@@ -29,13 +29,11 @@ package net.systemeD.potlatch2.save {
 
         private function save(callback:Function):void {
             var conn:Connection = Connection.getConnectionInstance();
-            if ( accessToken == null )
-                accessToken = conn.getAccessToken();
-        
-            if ( accessToken == null )
-                getNewToken(callback);
-            else
+            if (conn.hasAccessToken()) {
                 callback();
+            } else {
+                getNewToken(callback);
+            }
         }
 
         private function getNewToken(onCompletion:Function):void {
index 0f00d584cb2f73b49bd76c283e890f067fc2a9de..77607c76463dff942a2e5037fe1c68fc945c66fb 100755 (executable)
 
             // set the access token from saved cookie
             var tokenObject:SharedObject = SharedObject.getLocal("access_token");
-            conn.setAccessToken(tokenObject.data["key"], tokenObject.data["secret"]);
+            conn.setAccessToken(tokenObject.data["oauth_token"], tokenObject.data["oauth_token_secret"]);
 
                        // create GPS trackloader
                        trackLoader=new TrackLoader(theMap,conn.apiBase);