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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3d0f1b910f4eb57fafede8e7f355f83cc06fab6
|
4
|
+
data.tar.gz: fd7bcfdfcd6f9deb48d763a69401d7f248465164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
@@ -17,13 +17,11 @@ Ecm::UserArea.configure do |config|
|
|
17
17
|
#
|
18
18
|
config.base_mailer = 'ApplicationMailer'
|
19
19
|
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
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.
|
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:
|
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-
|
11
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|