egov_utils 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d19dfb5ded6ef5314f9dc4d673c4908c771da7694ecde5b7af5356cb5d5105f
|
4
|
+
data.tar.gz: 36f1ddf142197cce18d9634c9624dc2cd8b5653fcef52768928a81d2775f71b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06b49804aa5249f4f82565013610589fe2da31479461a7e669f48e57088d43186bd6a014042c6289cff2128eb53f6f44a12a80897158ed99342bdd5953346e83
|
7
|
+
data.tar.gz: 161ace127236cb20a45a5fd6600c18b15fd52548c26ddb96ec1e60782fddb9ffc209267cd93194d5531f3061741f28ebf0201047a55ef8ff56fce239ed0a1679
|
@@ -6,7 +6,7 @@ module EgovUtils
|
|
6
6
|
|
7
7
|
skip_before_action :require_login, only: [:new, :create, :confirm]
|
8
8
|
|
9
|
-
load_and_authorize_resource
|
9
|
+
load_and_authorize_resource only: [:index, :new, :create, :show, :destroy]
|
10
10
|
|
11
11
|
def index
|
12
12
|
providers
|
@@ -53,7 +53,7 @@ module EgovUtils
|
|
53
53
|
|
54
54
|
def approve
|
55
55
|
@user = User.find_by(id: params[:id])
|
56
|
-
render_404 and return
|
56
|
+
render_404 and return if @user.nil? || @user.active?
|
57
57
|
authorize!(:manage, User)
|
58
58
|
@user.update(active: true)
|
59
59
|
redirect_back(fallback_location: @user)
|
@@ -61,7 +61,7 @@ module EgovUtils
|
|
61
61
|
|
62
62
|
def confirm
|
63
63
|
@user = User.find_by(confirmation_code: params[:id])
|
64
|
-
render_404 and return if @user.nil? ||
|
64
|
+
render_404 and return if @user.nil? || @user.active? || @user.updated_at < (Time.now - 24.hours)
|
65
65
|
@user.update(active: true)
|
66
66
|
logged_user = @user
|
67
67
|
flash[:notice] = t('success_user_confirm')
|
data/lib/egov_utils/version.rb
CHANGED