Create option to force up-front authentication
authorAndy Allan <gravitystorm@gmail.com>
Tue, 19 Oct 2010 10:10:43 +0000 (10:10 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 19 Oct 2010 10:10:43 +0000 (10:10 +0000)
potlatch2.mxml

index 77607c7..9a1d391 100755 (executable)
                        // create GPS trackloader
                        trackLoader=new TrackLoader(theMap,conn.apiBase);
 
+            // Force authentication on startup, if required
+            // force_auth == force => checks for access token, and displays OAuth panel if needed
+            var force_auth:String = loaderInfo.parameters["force_auth"];
+            if (!conn.hasAccessToken() && force_auth == 'force') {
+              SaveManager.ensureAccess(onAccessChecked);
+            }
+
             // show help dialog on startup, if required
             // show_help == always => on every startup
             // show_help == once => show on first startup only
             theController.setState(new SelectedPOINode(node));
         }
 
+        /* Called when forcing an initial access token check. */
+        private function onAccessChecked():void {
+            // Floaty panel message "You now have access";
+        }
+
        ]]></mx:Script>
 
 </mx:Application>