clearance 1.14.1 → 1.14.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clearance might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 388172ea597e347bdc3de456ef71b97a3b2cedba
4
- data.tar.gz: 35009502fecdd3eac14aff84850a3f32edb05594
3
+ metadata.gz: 40854620afcb6b59bf196bbb4cfd0573c3eec03b
4
+ data.tar.gz: 69c381cdfb9a23b792b4566ea37932d8692cfc30
5
5
  SHA512:
6
- metadata.gz: 05b2d5f2d0c369a99a37f34962f7772a6f0a5af66aa29e8761b40e159fc8c21921cfb50893529eb7b6b92c4c2a9ee45fbe342fa23f64b4661181838c8651bff8
7
- data.tar.gz: 72e86acac7f47f097775b42f443171812bcc1e274d9d8aa96e3fe439926bfb87fec00364a69a8618ac10c79e220c2c2dd6a085345a54aa022d381f8db4e9a35d
6
+ metadata.gz: cb6b07886b51a27a1280aa4fa02e4eec6ec9804fc018c255e7ae573072ebf452b8347f810b6fecf4f3aba86f6cee46807bfd9e5339820f119fa1daa1403c409d
7
+ data.tar.gz: ef885276fba036cd91b5ed679edd62c459d0e70f6e7b74049b917b8d6c929376994a3e8942396bad490f5a5d182b1028fbe976920f50f302db37196143489dd4
@@ -36,5 +36,6 @@ install:
36
36
  branches:
37
37
  only:
38
38
  - master
39
+ - 2.0
39
40
 
40
41
  sudo: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clearance (1.14.1)
4
+ clearance (1.14.2)
5
5
  bcrypt
6
6
  email_validator (~> 1.4)
7
7
  rails (>= 3.1)
data/NEWS.md CHANGED
@@ -3,6 +3,14 @@
3
3
  The noteworthy changes for each Clearance version are included here. For a
4
4
  complete changelog, see the git history for each version via the version links.
5
5
 
6
+ ## [1.14.2] - August 10, 2016
7
+
8
+ ### Fixed
9
+ - Fixed incompatibility with `attr_encrypted` gem by inlining the body of the
10
+ `encrypt` helper method used in the BCrypt password strategy.
11
+
12
+ [1.14.2]: https://github.com/thoughtbot/clearance/compare/v1.14.1...v1.14.2
13
+
6
14
  ## [1.14.1] - May 12, 2016
7
15
 
8
16
  ### Fixed
data/README.md CHANGED
@@ -152,7 +152,8 @@ end
152
152
  See [config/routes.rb](/config/routes.rb) for the default set of routes.
153
153
 
154
154
  As of Clearance 1.5 it is recommended that you disable Clearance routes and take
155
- full control over routing and URL design.
155
+ full control over routing and URL design. This ensures that your app's URL design
156
+ won't be affected if the gem's routes and URL design are changed.
156
157
 
157
158
  To disable the routes, set `config.routes = false`. You can optionally run
158
159
  `rails generate clearance:routes` to dump a copy of the default routes into your
@@ -237,6 +238,9 @@ translation.
237
238
  See [config/locales/clearance.en.yml](/config/locales/clearance.en.yml) for the
238
239
  default behavior.
239
240
 
241
+ You can also install [clearance-i18n](https://github.com/thoughtbot/clearance-i18n)
242
+ for access to additional, user-contributed translations.
243
+
240
244
  ### User Model
241
245
 
242
246
  See [lib/clearance/user.rb](/lib/clearance/user.rb) for the default behavior.
@@ -19,30 +19,18 @@ module Clearance
19
19
  @password = new_password
20
20
 
21
21
  if new_password.present?
22
- self.encrypted_password = encrypt(new_password)
23
- end
24
- end
22
+ cost = if defined?(::Rails) && ::Rails.env.test?
23
+ ::BCrypt::Engine::MIN_COST
24
+ else
25
+ ::BCrypt::Engine::DEFAULT_COST
26
+ end
25
27
 
26
- private
27
-
28
- # @api private
29
- def encrypt(password)
30
- ::BCrypt::Password.create(password, cost: cost)
31
- end
32
-
33
- # @api private
34
- def cost
35
- if test_environment?
36
- ::BCrypt::Engine::MIN_COST
37
- else
38
- ::BCrypt::Engine::DEFAULT_COST
28
+ self.encrypted_password = ::BCrypt::Password.create(
29
+ new_password,
30
+ cost: cost,
31
+ )
39
32
  end
40
33
  end
41
-
42
- # @api private
43
- def test_environment?
44
- defined?(::Rails) && ::Rails.env.test?
45
- end
46
34
  end
47
35
  end
48
36
  end
@@ -135,7 +135,7 @@ module Clearance
135
135
  def authenticate(email, password)
136
136
  if user = find_by_normalized_email(email)
137
137
  if password.present? && user.authenticated?(password)
138
- return user
138
+ user
139
139
  end
140
140
  end
141
141
  end
@@ -1,3 +1,3 @@
1
1
  module Clearance
2
- VERSION = "1.14.1".freeze
2
+ VERSION = "1.14.2".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
@@ -25,7 +25,7 @@ authors:
25
25
  autorequire:
26
26
  bindir: bin
27
27
  cert_chain: []
28
- date: 2016-05-12 00:00:00.000000000 Z
28
+ date: 2016-08-10 00:00:00.000000000 Z
29
29
  dependencies:
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bcrypt