simple_auth 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8682ca22a814e3257391a8c00f4133534f0fc10
4
- data.tar.gz: 66f375cd6005a5e20236242b45c9e78746a622ac
3
+ metadata.gz: c7f989033172d408087d921e6b817deb6a797d86
4
+ data.tar.gz: 17baff56afe96566e89a03f86c762ca94dc7c273
5
5
  SHA512:
6
- metadata.gz: db21173167527172fdf0ccacaaa7551a0b1341742f75e3a2358391c2d844d4da16148ee920662d330fa23e3622c19783b16cdd288cdce5305aa9068c01391262
7
- data.tar.gz: 7b9bdd103c1aa3e8222b29ade7fb0348b762df8508584384a3f9a46d97f75d22fe2bd219fefcd9f2bde0a76ceb1ab0caf5bfecc5ecc2bcfa60ebe893f6760358
6
+ metadata.gz: bdbbac966ea1a128444781e0e024d61b84116f97eed31e35b1ff34080f025ee67357973f0c6d9177b8783e912dfbe120c747ac576dd6b352cddcc9143029165b
7
+ data.tar.gz: 7b466f1714756cb0925786814e6e1c40f59c14e715e02b096476a7e51f4683b7b1ebd6742357aa2ab23e2f35dbc6a1f0cbb622ceaeb081fba621b2e1cfc760d7
@@ -1,3 +1,11 @@
1
+ # v2.0.3
2
+
3
+ - Assign the raw password/confirmation, so we can apply validations on the raw value.
4
+
5
+ # v2.0.2
6
+
7
+ - The compat wasn't validating fields correctly.
8
+
1
9
  # v2.0.1
2
10
 
3
11
  - The compat mode wasn't generating the `password_digest`.
@@ -17,10 +17,7 @@ module SimpleAuth
17
17
  module InstanceMethods
18
18
  def password=(password)
19
19
  super SimpleAuth::Config.crypter.call(password, password_salt)
20
- end
21
-
22
- def password_confirmation=(password)
23
- super SimpleAuth::Config.crypter.call(password, password_salt)
20
+ @password = password
24
21
  end
25
22
 
26
23
  def authenticate(password)
@@ -2,7 +2,7 @@ module SimpleAuth
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 2
5
+ PATCH = 3
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -10,7 +10,6 @@ describe SimpleAuth, "compatibility mode" do
10
10
  after :all do
11
11
  mod = SimpleAuth::ActiveRecord::InstanceMethods
12
12
  mod.send :remove_method, :password=
13
- mod.send :remove_method, :password_confirmation=
14
13
  mod.send :remove_method, :authenticate
15
14
  end
16
15
 
@@ -34,8 +33,13 @@ describe SimpleAuth, "compatibility mode" do
34
33
  expect(customer.password_digest).to be_present
35
34
  end
36
35
 
37
- it "assigns password confirmation" do
36
+ it "sets password" do
38
37
  customer = Customer.create(password: "test", password_confirmation: "test")
39
- expect(customer.password_confirmation).to be_present
38
+ expect(customer.password).to eql("test")
39
+ end
40
+
41
+ it "sets password confirmation" do
42
+ customer = Customer.create(password: "test", password_confirmation: "test")
43
+ expect(customer.password_confirmation).to eql("test")
40
44
  end
41
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira