allow current_user => nil for pages that do not require login
authorTom Clegg <tom@clinicalfuture.com>
Sun, 3 Feb 2013 08:56:45 +0000 (00:56 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Sun, 3 Feb 2013 08:56:45 +0000 (00:56 -0800)
app/controllers/application_controller.rb

index eb4d62ca570f54bb96e8d1750b6aa9c674dea39a..4ce0d55ba0351866866a648ad126e3c3dc50f996 100644 (file)
@@ -64,7 +64,9 @@ class ApplicationController < ActionController::Base
   end
 
   def current_user
-    @current_user ||= User.current
+    if Thread.current[:api_token]
+      @current_user ||= User.current
+    end
   end
 
   protected