minimalist_authentication 2.1.2 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/app/controllers/emails_controller.rb +1 -1
- data/lib/minimalist_authentication/sessions.rb +8 -3
- data/lib/minimalist_authentication/user.rb +3 -3
- data/lib/minimalist_authentication/verifiable_token.rb +1 -1
- data/lib/minimalist_authentication/version.rb +1 -1
- metadata +26 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7393c90dec001c1a5cc41a7671335a14525c2df82b5b1ef6f09695d0f5eb618d
|
4
|
+
data.tar.gz: 5938f2b31f6139096fd59b4c2257d6056b216d276e4d4cfbad5c67edd34cbed5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f84a1b08c525c57f5974d7d73f7eba50835952ea29ff8f9336d2e31af53a92074f59cb319002ab6647dddeab6cb126077cb92a01c5349a6ad5a1980e4c4c75d4
|
7
|
+
data.tar.gz: 75636fe9e427511d02809c232fd6bb6692fa5bdad2db564391ce5e97a4d8cecee149f836330849f006c8d470509f283b6c641812967dbedac058464ead0d47c5
|
data/README.md
CHANGED
@@ -147,4 +147,4 @@ When the conversion is complete the **crypted_password**, **salt**, and
|
|
147
147
|
|
148
148
|
|
149
149
|
## License
|
150
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT)
|
150
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT)..
|
@@ -3,8 +3,8 @@ module MinimalistAuthentication
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
skip_before_action
|
7
|
-
|
6
|
+
skip_before_action :authorization_required, only: %i(new create)
|
7
|
+
before_action :redirect_logged_in_users, only: :new
|
8
8
|
end
|
9
9
|
|
10
10
|
def new
|
@@ -53,6 +53,11 @@ module MinimalistAuthentication
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
def redirect_logged_in_users
|
57
|
+
redirect_to(login_redirect_to) if logged_in?
|
58
|
+
end
|
59
|
+
|
60
|
+
|
56
61
|
def after_authentication_success
|
57
62
|
redirect_back_or_default(login_redirect_to)
|
58
63
|
end
|
@@ -69,7 +74,7 @@ module MinimalistAuthentication
|
|
69
74
|
end
|
70
75
|
|
71
76
|
def scrub_session!
|
72
|
-
(session.keys - %w(session_id
|
77
|
+
(session.keys - %w(session_id return_to)).each do |key|
|
73
78
|
session.delete(key)
|
74
79
|
end
|
75
80
|
end
|
@@ -20,9 +20,9 @@ module MinimalistAuthentication
|
|
20
20
|
before_save :hash_password
|
21
21
|
|
22
22
|
# Email validations
|
23
|
-
validates_presence_of :email,
|
24
|
-
validates_uniqueness_of :email, allow_blank: true,
|
25
|
-
validates_format_of :email, allow_blank: true, with: EMAIL_REGEX,
|
23
|
+
validates_presence_of :email, if: :validate_email_presence?
|
24
|
+
validates_uniqueness_of :email, allow_blank: true, case_sensitive: false, if: :validate_email?
|
25
|
+
validates_format_of :email, allow_blank: true, with: EMAIL_REGEX, if: :validate_email?
|
26
26
|
|
27
27
|
# Password validations
|
28
28
|
validates_presence_of :password, if: :validate_password?
|
metadata
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimalist_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Baldwin
|
8
8
|
- Brightways Learning
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '5.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '5.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
@@ -46,19 +46,33 @@ dependencies:
|
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.1.3
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
49
|
+
name: loofah
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
type: :
|
54
|
+
version: 2.3.1
|
55
|
+
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.3.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: sqlite3
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.3'
|
62
76
|
description: A Rails authentication plugin that takes a minimalist approach. It is
|
63
77
|
designed to be simple to understand, use, and modify for your application.
|
64
78
|
email:
|
@@ -110,7 +124,7 @@ homepage: https://github.com/wwidea/minimalist_authentication
|
|
110
124
|
licenses:
|
111
125
|
- MIT
|
112
126
|
metadata: {}
|
113
|
-
post_install_message:
|
127
|
+
post_install_message:
|
114
128
|
rdoc_options: []
|
115
129
|
require_paths:
|
116
130
|
- lib
|
@@ -125,9 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
139
|
- !ruby/object:Gem::Version
|
126
140
|
version: '0'
|
127
141
|
requirements: []
|
128
|
-
|
129
|
-
|
130
|
-
signing_key:
|
142
|
+
rubygems_version: 3.1.2
|
143
|
+
signing_key:
|
131
144
|
specification_version: 4
|
132
145
|
summary: A Rails authentication plugin that takes a minimalist approach.
|
133
146
|
test_files: []
|