Class: Phcscriptcdnpro::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Phcscriptcdnpro::ApplicationController
- Defined in:
- app/controllers/phcscriptcdnpro/application_controller.rb
Direct Known Subclasses
Scriptcdn::AuthorsController, Scriptcdn::InformationsController, Scriptcdn::MainsController, Scriptcdn::UrlsController, Scriptcdn::VersionsController
Instance Method Summary collapse
- #current_user ⇒ Object
- #new_login_url ⇒ Object
-
#require_user ⇒ Object
AuthRocket User Helpers.
Instance Method Details
#current_user ⇒ Object
12 13 14 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 12 def current_user @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user) end |
#new_login_url ⇒ Object
17 18 19 20 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 17 def new_login_url ENV['AUTHROCKET_LOGIN_URL'] # $ar_login_url end |
#require_user ⇒ Object
AuthRocket User Helpers
5 6 7 8 9 10 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 5 def require_user unless current_user session[:last_url] = request.get? ? url_for(params) : url_for redirect_to new_login_url end end |