ecm_user_area2 3.0.1 → 3.0.2

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: 445334955a86ff75f2c1c0fc02c771a8cf176ca7
4
- data.tar.gz: ffa5b8a4137909dc027df16353cc1d1318bed186
3
+ metadata.gz: 6eecd4b87b1174b7a7e6d023402719827e6d38aa
4
+ data.tar.gz: 40d20a28c0c30f85fbb9454b59bf5b9db58986fd
5
5
  SHA512:
6
- metadata.gz: 0bd4b6c84dfd49ffab73106598f2ed17a0fd5131d4ad3b5e14424f3016ffb48b704210e27b0b722e3761e33cde899df0a3e2238070849b8032efd6c98140bc70
7
- data.tar.gz: 02dbeaa5fe3e729cf1ca65c78ea4eeab08ccf592e50c36d1e8540e8488aab299b523dc9812f655ba829f220acae1671f3d7ea8d91f2f8fa1966e2ff1bf420d82
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
- include Controller::ResourceConcern
6
- include Controller::ResourceInflectionsConcern
7
- include Controller::ResourceUrlsConcern
8
- include Controller::RestActionsConcern
9
- include Controller::RedirectBackConcern
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
- 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
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
- 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
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
- def load_user_by_token
38
- User.find_using_perishable_token(params[:token])
39
- end
35
+ private
36
+
37
+ def load_user_by_token
38
+ User.find_using_perishable_token(params[:token])
39
+ end
40
40
 
41
41
 
42
- def permitted_params
43
- params.require(resource_class.name.demodulize.underscore.to_sym).permit(:email)
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
@@ -1,5 +1,6 @@
1
1
  module Ecm
2
2
  module UserArea
3
3
  module PasswordResets
4
+ end
4
5
  end
5
6
  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
- include Controller::ResourceConcern
6
- include Controller::ResourceInflectionsConcern
7
- include Controller::ResourceUrlsConcern
8
- include Controller::RestActionsConcern
9
- include Controller::RedirectBackConcern
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
- before_action :find_using_perishable_token
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
- private
17
+ before_action :find_using_perishable_token
20
18
 
21
- def load_resource
22
- @resource
23
- end
19
+ private
24
20
 
25
- def load_resource
26
- User.find_using_perishable_token(params[:token])
27
- end
21
+ def load_resource
22
+ @resource
23
+ end
28
24
 
29
- def permitted_params
30
- params.require(:user).permit(:password, :password_confirmation)
31
- end
25
+ def load_resource
26
+ User.find_using_perishable_token(params[:token])
27
+ end
32
28
 
33
- def after_update_location
34
- new_user_session_path
35
- end
29
+ def permitted_params
30
+ params.require(:user).permit(:password, :password_confirmation)
31
+ end
36
32
 
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?
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
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module UserArea
3
- VERSION = '3.0.1'.freeze
3
+ VERSION = '3.0.2'.freeze
4
4
  end
5
5
  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.1
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-15 00:00:00.000000000 Z
11
+ date: 2018-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails