ecm_user_area2 3.0.1 → 3.0.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eecd4b87b1174b7a7e6d023402719827e6d38aa
|
4
|
+
data.tar.gz: 40d20a28c0c30f85fbb9454b59bf5b9db58986fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e9591e0f3c35552e4be135f791801a839623962a63b4a4893767ffcc8e2234c03bab79bdc5e556e52fefab3f9b11403fb4d8c198440ff76ebb6a144452c0b80
|
7
|
+
data.tar.gz: a30ad2c64f285f50aa5b6f1c4e4f371a51059921c26f53bbb862743735efa3ba979fda75d88888aa8f2572baa53a686653ab11e592b73bb1c496d1ebd4830987
|
@@ -2,45 +2,46 @@ module Ecm
|
|
2
2
|
module UserArea
|
3
3
|
module PasswordResetRequests
|
4
4
|
class BaseController < Ecm::UserArea::Configuration.base_controller.constantize
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
if Rails.version < '5'
|
12
|
-
skip_before_action :authenticate_user!
|
13
|
-
else
|
14
|
-
skip_before_action :authenticate_user!, raise: false
|
15
|
-
end
|
5
|
+
include ResourcesController::Resources
|
6
|
+
include ResourcesController::ResourceInflections
|
7
|
+
include ResourcesController::RestResourceUrls
|
8
|
+
include ResourcesController::RestActions
|
9
|
+
include Controller::RedirectBackConcern
|
16
10
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
11
|
+
if Rails.version < '5'
|
12
|
+
skip_before_action :authenticate_user!
|
13
|
+
else
|
14
|
+
skip_before_action :authenticate_user!, raise: false
|
15
|
+
end
|
23
16
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
return
|
17
|
+
def create
|
18
|
+
@resource = resource_class.new(permitted_params)
|
19
|
+
@resource.host = request.host
|
20
|
+
@resource.save
|
21
|
+
respond_with @resource, location: after_create_location
|
30
22
|
end
|
31
|
-
respond_with @resource
|
32
|
-
end
|
33
23
|
|
24
|
+
def edit
|
25
|
+
@resource = load_user_by_token
|
26
|
+
unless @resource
|
27
|
+
flash[:error] = t('.user_not_found')
|
28
|
+
redirect_to new_user_session_path
|
29
|
+
return
|
30
|
+
end
|
31
|
+
respond_with @resource
|
32
|
+
end
|
34
33
|
|
35
|
-
private
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
private
|
36
|
+
|
37
|
+
def load_user_by_token
|
38
|
+
User.find_using_perishable_token(params[:token])
|
39
|
+
end
|
40
40
|
|
41
41
|
|
42
|
-
|
43
|
-
|
42
|
+
def permitted_params
|
43
|
+
params.require(resource_class.name.demodulize.underscore.to_sym).permit(:email)
|
44
|
+
end
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
@@ -2,46 +2,47 @@ module Ecm
|
|
2
2
|
module UserArea
|
3
3
|
module PasswordResets
|
4
4
|
class BaseController < Ecm::UserArea::Configuration.base_controller.constantize
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
if Rails.version < '5'
|
12
|
-
skip_before_action :authenticate_user!
|
13
|
-
else
|
14
|
-
skip_before_action :authenticate_user!, raise: false
|
15
|
-
end
|
5
|
+
include ResourcesController::Resources
|
6
|
+
include ResourcesController::ResourceInflections
|
7
|
+
include ResourcesController::RestResourceUrls
|
8
|
+
include ResourcesController::RestActions
|
9
|
+
include Controller::RedirectBackConcern
|
16
10
|
|
17
|
-
|
11
|
+
if Rails.version < '5'
|
12
|
+
skip_before_action :authenticate_user!
|
13
|
+
else
|
14
|
+
skip_before_action :authenticate_user!, raise: false
|
15
|
+
end
|
18
16
|
|
19
|
-
|
17
|
+
before_action :find_using_perishable_token
|
20
18
|
|
21
|
-
|
22
|
-
@resource
|
23
|
-
end
|
19
|
+
private
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
def load_resource
|
22
|
+
@resource
|
23
|
+
end
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
def load_resource
|
26
|
+
User.find_using_perishable_token(params[:token])
|
27
|
+
end
|
32
28
|
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
def permitted_params
|
30
|
+
params.require(:user).permit(:password, :password_confirmation)
|
31
|
+
end
|
36
32
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
33
|
+
def after_update_location
|
34
|
+
new_user_session_path
|
35
|
+
end
|
36
|
+
|
37
|
+
def handle_user_not_found
|
38
|
+
redirect_to new_user_session_path, notice: t("messages.failures.ecm_user_area.perishable_token_invalid")
|
39
|
+
end
|
40
|
+
|
41
|
+
def find_using_perishable_token
|
42
|
+
@resource = User.find_using_perishable_token(params[:token])
|
43
|
+
handle_user_not_found if @resource.nil?
|
44
|
+
end
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
47
|
-
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_user_area2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|