   $rootScope.initializing  = true
 
   pwgFlash.init() # initialize the flash service
-
+  ###
   $rootScope.$watch "loggedInUser", (user, prevUser) ->
     return if user is prevUser
 

      $rootScope.redirectToSegment segment
    else
      $rootScope.redirectToSegment "login"

  # Page-handling.



  # On initial load or reload, we need to determine whether the user is
  # still logged in, since a reload clears everything in the browser.

  $rootScope.redirectIfNotLoggedIn

  onSuccess = (response) ->
    $rootScope.initializing = false
