phcmemberspro 9.5.2 → 9.5.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba844ea89a6797eef4987213a6f0481b124b1e8f
|
4
|
+
data.tar.gz: f8045dd288ecab629143281b7f896ac5eea41f55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c8752ce333cfecc15565a849d7e2add79becbe3807bee73ea1150242a335085db610c86b3adbd618f8992cf6b2895bab2f3d9e9dc73c559d069ec3dcd19d6d7
|
7
|
+
data.tar.gz: a444f92472154596d0c3af30a848c18faa7cbff3215dedba873c60c775dfc05be2a24642f55dbf7fdf1a5c84da49d2d5ba8aaad93b1514ef93cb4e6c8fbeb047
|
@@ -2,6 +2,7 @@ module Phcmemberspro
|
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
|
4
4
|
# Security Filters
|
5
|
+
before_action :require_user
|
5
6
|
protect_from_forgery with: :exception
|
6
7
|
|
7
8
|
# Grab Member Information
|
@@ -9,6 +10,29 @@ module Phcmemberspro
|
|
9
10
|
@members_profile_info = Member::Profile.find(params[:profile_id])
|
10
11
|
end
|
11
12
|
|
13
|
+
# AuthRocket User Helpers
|
14
|
+
def require_user
|
15
|
+
unless current_user
|
16
|
+
params.permit!
|
17
|
+
session[:last_url] = request.get? ? url_for(params) : url_for
|
18
|
+
redirect_to new_login_url
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def current_user
|
23
|
+
@_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
|
24
|
+
end
|
25
|
+
helper_method :current_user
|
26
|
+
|
27
|
+
def new_login_url
|
28
|
+
ENV['AUTHROCKET_LOGIN_URL']
|
29
|
+
end
|
30
|
+
helper_method :new_login_url
|
31
|
+
|
32
|
+
def membership_info
|
33
|
+
AuthRocket::Membership.all(user_id: current_user.id).first
|
34
|
+
end
|
35
|
+
|
12
36
|
# Load Helpers
|
13
37
|
helper Phctitleseo::Engine.helpers
|
14
38
|
helper Phcnotifi::Engine.helpers
|