ecm_user_area2 3.1.2 → 4.0.1

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: aab8847a2b298a6d1918836571a5c62d33697abd
4
- data.tar.gz: 66581f93a3a008330a75382b31600047019663d9
3
+ metadata.gz: b3d0f1b910f4eb57fafede8e7f355f83cc06fab6
4
+ data.tar.gz: fd7bcfdfcd6f9deb48d763a69401d7f248465164
5
5
  SHA512:
6
- metadata.gz: 0fa6cad40fcf5c5290131f1802c4a9d617269d3d4fa9b55cba24d5bbc30dcf07de406b350c05abf8681881611848da437beb2bc5aa3ee547e5c75b5df683e414
7
- data.tar.gz: 1fe13e22c809ecd72a61d2cc104986b27dd2adbe41782de2a74ebfe7f267995a36fd42141806a82dc88ad7637345f79e463fb26d58eb18cb602d26aa41c26df7
6
+ metadata.gz: aa468baf9366e264666cd3875cbaa86262444e78b1c6b40086c19a22e469138d788b42c774905195290aa99a533ffb929cd1356e3ab67e33c423ad01f506b71f
7
+ data.tar.gz: 587ccd6e3f1ce60a8b9bb8ad887bb5fa01b8cb89821fd2250717ef027598300e364bf34763a2e20fdcf335c09268c207300b5d31dbd15dd5236af26c579210d8
data/README.rdoc CHANGED
@@ -1,5 +1,14 @@
1
1
  = ECM User Area
2
2
 
3
+ = Migration to 4.0.0
4
+
5
+ Defining after_sign_in_url in the controller is not supported anymore. Control
6
+ the after sign in location by configuring it in the initializer:
7
+
8
+ # config/initalizers/ecm_user_area.rb
9
+ Ecm::UserArea.configure do |config|
10
+ config.after_sign_in_url = ->(controller) { last_location || main_app.root_path }
11
+ end
3
12
 
4
13
  = Installation
5
14
 
@@ -9,6 +9,7 @@ module Ecm
9
9
  include ResourcesController::LocationHistory
10
10
 
11
11
  skip_before_action :authenticate_user!, only: [:new, :create], raise: false
12
+ skip_before_action :store_location, only: [:new, :create]
12
13
 
13
14
  def new
14
15
  @session = initialize_resource
@@ -20,11 +21,7 @@ module Ecm
20
21
 
21
22
  if @session.save
22
23
  flash[:notice] = I18n.t('messages.success.ecm_user_area.signed_in') unless request.xhr?
23
- if Configuration.force_after_sign_in_url
24
- redirect_to(after_sign_in_url)
25
- else
26
- redirect_back_or(after_sign_in_url)
27
- end
24
+ redirect_to(instance_eval(&Configuration.after_sign_in_url))
28
25
  return
29
26
  else
30
27
  render action: :new
@@ -43,10 +40,6 @@ module Ecm
43
40
 
44
41
  private
45
42
 
46
- def after_sign_in_url
47
- defined?(super) ? super : main_app.root_path
48
- end
49
-
50
43
  def permitted_params
51
44
  if Rails.version < '5'
52
45
  params.require(resource_class.name.demodulize.underscore.tr('/', '_')).permit(:email, :password)
@@ -13,7 +13,6 @@ module Ecm
13
13
  mattr_accessor(:allow_users_to_destroy_self) { true }
14
14
  mattr_accessor(:base_controller) { 'FrontendController' }
15
15
  mattr_accessor(:base_mailer) { 'ApplicationMailer' }
16
- mattr_accessor(:force_after_sign_in_url) { false }
17
16
  mattr_accessor(:acts_as_authentic_options) do
18
17
  ->(config) do
19
18
  config.crypto_provider = Authlogic::CryptoProviders::BCrypt
@@ -27,6 +26,7 @@ module Ecm
27
26
  end
28
27
  end
29
28
  mattr_accessor(:current_user_additional_table_rows_proc) { nil }
29
+ mattr_accessor(:after_sign_in_url) { ->(controller) { main_app.root_path } }
30
30
  end
31
31
  end
32
32
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module UserArea
3
- VERSION = '3.1.2'.freeze
3
+ VERSION = '4.0.1'.freeze
4
4
  end
5
5
  end
@@ -17,13 +17,11 @@ Ecm::UserArea.configure do |config|
17
17
  #
18
18
  config.base_mailer = 'ApplicationMailer'
19
19
 
20
- # Settings this to true forces the after_sign_in_url after sign in.
21
- # If set to false, redirect to previous location will happen if
22
- # existent.
23
- #
24
- # Default: config.force_after_sign_in_url = false
20
+ # Where to redirect to after successful login
21
+ #
22
+ # Default: config.after_sign_in_url = ->(controller) { main_app.root_path }
25
23
  #
26
- config.force_after_sign_in_url = false
24
+ config.after_sign_in_url = ->(controller) { main_app.root_path }
27
25
 
28
26
  # This is the block, that will be passed to the acts_as_authentic call
29
27
  # in the user model.
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.1.2
4
+ version: 4.0.1
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-03-24 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails