Class: Phcpresspro::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Phcpresspro::ApplicationController
- Defined in:
- app/controllers/phcpresspro/application_controller.rb
Direct Known Subclasses
Phcpresspro::Articles::PostsController, Frontend::ArticlesController, Modules::CategoriesController, Modules::ConnectionsController
Instance Method Summary collapse
- #current_user ⇒ Object
-
#get_member_profile_info ⇒ Object
Grab Member Information.
- #membership_info ⇒ Object
- #new_login_url ⇒ Object
-
#require_user ⇒ Object
AuthRocket User Helpers.
Instance Method Details
#current_user ⇒ Object
17 18 19 |
# File 'app/controllers/phcpresspro/application_controller.rb', line 17 def current_user @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user) end |
#get_member_profile_info ⇒ Object
Grab Member Information
28 29 30 |
# File 'app/controllers/phcpresspro/application_controller.rb', line 28 def get_member_profile_info @members_profile_info = Member::Profile.find(params[:profile_id]) end |
#membership_info ⇒ Object
32 33 34 |
# File 'app/controllers/phcpresspro/application_controller.rb', line 32 def membership_info AuthRocket::Membership.all(user_id: current_user.id).first end |
#new_login_url ⇒ Object
22 23 24 |
# File 'app/controllers/phcpresspro/application_controller.rb', line 22 def new_login_url ENV['AUTHROCKET_LOGIN_URL'] end |
#require_user ⇒ Object
AuthRocket User Helpers
9 10 11 12 13 14 15 |
# File 'app/controllers/phcpresspro/application_controller.rb', line 9 def require_user unless current_user params.permit! session[:last_url] = request.get? ? url_for(params) : url_for redirect_to new_login_url end end |