Fix test for :orvos_api_token in Thread.current, and log errors if it is
authorWard Vandewege <ward@clinicalfuture.com>
Sun, 3 Feb 2013 20:43:13 +0000 (15:43 -0500)
committerWard Vandewege <ward@clinicalfuture.com>
Sun, 3 Feb 2013 20:43:13 +0000 (15:43 -0500)
not there.

app/controllers/application_controller.rb

index 4ce0d55ba0351866866a648ad126e3c3dc50f996..a0b4fd9892990981b9e8152aaca7e41311147462 100644 (file)
@@ -64,8 +64,11 @@ class ApplicationController < ActionController::Base
   end
 
   def current_user
-    if Thread.current[:api_token]
+    if Thread.current[:orvos_api_token]
       @current_user ||= User.current
+    else
+      logger.error "No API token in Thread"
+      return nil
     end
   end