Class: Api::BaseController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Api::BaseController
- Defined in:
- lib/generators/petergate_api/templates/app/controllers/api/base_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#current_user ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/generators/petergate_api/templates/app/controllers/api/base_controller.rb', line 4 def current_user @user ||= begin if request.headers["Authorization"] # you might want to check redis or memcache to for cache invalidation ::ApiUser.new(request.headers["Authorization"]) else nil end end end |