card-mod-account 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/set/all/account.rb +7 -5
- data/set/self/signin.rb +14 -27
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8c86e418e23551b4e344d47073a5cea56789cab7a091d0ece4d6b7488bfe4fe
|
4
|
+
data.tar.gz: 1a18cfb82d88f0bcca51ec77b99237bbe4c5527db7bb527fbcaeff0d87338863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7103bb8aea180221f488ed16dfce14862f7d4d7228110177a9d9b0423144220c383c1c4ec7b1651f07f997b5440cf49c5378cc377df8497ba6240ca38c44548
|
7
|
+
data.tar.gz: 04bc2d61a8f17c24f2d6d1aa06eb7aa978afd78a70593007e27a25bfeb247e869f43f4bccd46d203ebbe93cfa08f2377864bdb7bb2c04e285e2a30a08bd32d9c
|
data/set/all/account.rb
CHANGED
@@ -63,15 +63,17 @@ def all_roles
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def enabled_role_ids
|
66
|
-
|
67
|
-
# workaround for broken migrations
|
68
|
-
return fetch_roles unless Card::Codename.exists? :enabled_roles
|
69
|
-
|
70
|
-
enabled = enabled_roles_card
|
66
|
+
with_enabled_roles do |enabled|
|
71
67
|
enabled.virtual? ? enabled.item_ids : fetch_roles
|
72
68
|
end
|
73
69
|
end
|
74
70
|
|
71
|
+
def with_enabled_roles
|
72
|
+
Auth.as_bot do
|
73
|
+
Card::Codename.exists?(:enabled_roles) ? yield(enabled_roles_card) : fetch_roles
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
75
77
|
def enabled_roles_card
|
76
78
|
fetch :enabled_roles, eager_cache: true, new: { type_id: SessionID }
|
77
79
|
end
|
data/set/self/signin.rb
CHANGED
@@ -30,8 +30,13 @@ end
|
|
30
30
|
# triggered by clicking "Reset my Password", this sends out the verification password
|
31
31
|
# and aborts (does not sign in)
|
32
32
|
event :send_reset_password_token, before: :signin, on: :update, trigger: :required do
|
33
|
-
|
34
|
-
|
33
|
+
aborting do
|
34
|
+
blank_email? ? break : send_reset_password_email_or_fail
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def email_from_subfield
|
39
|
+
@email_from_subfield ||= subfield(:email)&.content
|
35
40
|
end
|
36
41
|
|
37
42
|
def ok_to_read
|
@@ -83,34 +88,16 @@ def account_for email
|
|
83
88
|
Auth.find_account_by_email email
|
84
89
|
end
|
85
90
|
|
86
|
-
def send_reset_password_email_or_fail
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
Auth.as_bot { account.send_password_reset_email }
|
92
|
-
elsif account
|
93
|
-
errors.add :account, i18n_signin(:error_not_active)
|
94
|
-
else
|
95
|
-
errors.add :email, i18n_signin(:error_not_recognized)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def send_reset_password_email_or_fail email
|
101
|
-
aborting do
|
102
|
-
break if blank_email? email
|
103
|
-
|
104
|
-
if (account = account_for email)&.active?
|
105
|
-
send_reset_password_email account
|
106
|
-
else
|
107
|
-
reset_password_fail account
|
108
|
-
end
|
91
|
+
def send_reset_password_email_or_fail
|
92
|
+
if (account = account_for email_from_subfield)&.active?
|
93
|
+
send_reset_password_email account
|
94
|
+
else
|
95
|
+
reset_password_fail account
|
109
96
|
end
|
110
97
|
end
|
111
98
|
|
112
|
-
def blank_email?
|
113
|
-
return false if
|
99
|
+
def blank_email?
|
100
|
+
return false if email_from_subfield.present?
|
114
101
|
|
115
102
|
error_on :email, :error_blank
|
116
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-account
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-03-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,56 +18,56 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.101.
|
21
|
+
version: 1.101.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.101.
|
28
|
+
version: 1.101.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: card-mod-email
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.11.
|
35
|
+
version: 0.11.1
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.11.
|
42
|
+
version: 0.11.1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: card-mod-permissions
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.11.
|
49
|
+
version: 0.11.1
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.11.
|
56
|
+
version: 0.11.1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: card-mod-list
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.11.
|
63
|
+
version: 0.11.1
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.11.
|
70
|
+
version: 0.11.1
|
71
71
|
description: ''
|
72
72
|
email:
|
73
73
|
- info@decko.org
|