devise_castle 1.3.1 → 1.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fed2b4bde70c3fb648b8b73ba596ddae8c57c87c
|
4
|
+
data.tar.gz: 4235c9af1d89be5575a18c8247f0afc2c4f51e93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa706cce1ce7efdf2e096ebf71b783106aed6595cfd4153a68be8c33ab6aebd9d81e51ae6c0dd4ac4e103ed051438f6dc314be5f8dc3751cb872f86ac77b59c0
|
7
|
+
data.tar.gz: 31eb367a77bef0ad819a3c15d20267755a41ad06cefab41d15f00f5496040d968e5fcdd47ff4704b6ec54ee8d0142891e6ba82b245ffe9251440da3b2cd5ccb6
|
@@ -9,6 +9,8 @@ class DeviseCastle::PasswordsController < Devise::PasswordsController
|
|
9
9
|
end
|
10
10
|
|
11
11
|
super do |resource|
|
12
|
+
return if resource.respond_to?(:castle_do_not_track?) && resource.castle_do_not_track?
|
13
|
+
|
12
14
|
castle.track(
|
13
15
|
name: '$password_reset.requested',
|
14
16
|
details: {
|
@@ -19,6 +21,8 @@ class DeviseCastle::PasswordsController < Devise::PasswordsController
|
|
19
21
|
|
20
22
|
def update
|
21
23
|
super do |resource|
|
24
|
+
return if resource.respond_to?(:castle_do_not_track?) && resource.castle_do_not_track?
|
25
|
+
|
22
26
|
if resource.errors.empty?
|
23
27
|
castle.track(
|
24
28
|
name: '$password_reset.succeeded',
|
data/lib/devise_castle/hooks.rb
CHANGED
@@ -7,8 +7,10 @@ end
|
|
7
7
|
# Track logout.succeeded
|
8
8
|
Warden::Manager.before_logout do |record, warden, opts|
|
9
9
|
if record.respond_to?(:castle_id)
|
10
|
-
|
11
|
-
|
10
|
+
unless record.respond_to?(:castle_do_not_track?) && record.castle_do_not_track?
|
11
|
+
castle = warden.request.env['castle']
|
12
|
+
castle.track(user_id: record._castle_id, name: '$logout.succeeded')
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
@@ -33,10 +35,12 @@ end
|
|
33
35
|
# Track login.succeeded
|
34
36
|
Warden::Manager.after_set_user :except => :fetch do |record, warden, opts|
|
35
37
|
if record.respond_to?(:castle_id)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
unless record.respond_to?(:castle_do_not_track?) && record.castle_do_not_track?
|
39
|
+
castle = warden.request.env['castle']
|
40
|
+
castle.identify(record._castle_id, {
|
41
|
+
email: record.email
|
42
|
+
})
|
43
|
+
castle.track(user_id: record._castle_id, name: '$login.succeeded')
|
44
|
+
end
|
41
45
|
end
|
42
46
|
end
|
data/lib/devise_castle/model.rb
CHANGED
@@ -33,6 +33,15 @@
|
|
33
33
|
def _castle_id
|
34
34
|
URI.encode(castle_id.to_s)
|
35
35
|
end
|
36
|
+
|
37
|
+
# Disable Devise model tracking
|
38
|
+
def castle_do_not_track!
|
39
|
+
@castle_do_not_track = true
|
40
|
+
end
|
41
|
+
|
42
|
+
def castle_do_not_track?
|
43
|
+
@castle_do_not_track || false
|
44
|
+
end
|
36
45
|
end
|
37
46
|
end
|
38
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_castle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Brissmyr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.1
|
47
|
+
version: '1.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.1
|
54
|
+
version: '1.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- app/controllers/devise_castle/passwords_controller.rb
|
92
92
|
- app/controllers/devise_castle/registrations_controller.rb
|
93
93
|
- app/controllers/devise_castle/sessions_controller.rb
|
94
|
+
- config/locales/en.yml
|
94
95
|
- lib/devise_castle.rb
|
95
96
|
- lib/devise_castle/controllers/helpers.rb
|
96
97
|
- lib/devise_castle/hooks.rb
|