infobip-twofactor 1.0.0 → 1.0.1

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: 56411b5a553e4bcc955e3abec3ed2df44288b9fc
4
- data.tar.gz: a061f0e44d3817e056da19acd18afe88f4924171
3
+ metadata.gz: a5e31fd0716a9b302a593c60f0eadbdb5dcd04a7
4
+ data.tar.gz: 2ab4169ba41545cc68366f3f5f9e5801b3873676
5
5
  SHA512:
6
- metadata.gz: 0044a5643747128a98f1c7168dabe980c78af53da75eca534f5c7800735e1dc25589657a8cd1c49a8045f03eba833b3520f05f288081c94c06e3dc15993b0625
7
- data.tar.gz: d3ba9d5131c5206bcbe1aa1251ca05a9d5a02f4fd8f492c5779309738560c7ef482720f57b6e7ba19f019d5754f28bc62e26c0f35b887f17c166c2ea1532874c
6
+ metadata.gz: a60e6bfbf5a5ee6051b196daf0b3e9b3c92c576bcea52cdc851a2c03de90f51396a7982bc80f6eccbfb9424a0ba092bcc6fe5f75ba0db9de56b8f1e5d737d24a
7
+ data.tar.gz: bb8d091f16eea12c75b945aebd83c0c2633c044cadefe8eb37bac8a10eafc937900eb9d48fef1951905969dc97f0f79c4f8a35b38e268af5bd84336363cbbab0
@@ -6,7 +6,6 @@ module Infobip
6
6
  class API
7
7
 
8
8
  attr_reader :api_key
9
- attr_reader :pin_id
10
9
  attr_reader :application_id
11
10
  attr_reader :message_id
12
11
 
@@ -44,9 +43,9 @@ module Infobip
44
43
  response
45
44
  end
46
45
 
47
- def verify_pin(pin)
48
- raise "Missing pin id" unless @pin_id
49
- response = @api.pin(@pin_id).verify._post(pin: pin)
46
+ def verify_pin(pin_id, pin)
47
+ raise "Missing pin id" unless pin_id
48
+ response = @api.pin(pin_id).verify._post(pin: pin)
50
49
  raise "Malformed two factor API response - no verified field" unless (response.respond_to?(:verified))
51
50
  response
52
51
  end
@@ -1,5 +1,5 @@
1
1
  module Infobip
2
2
  module Twofactor
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -28,14 +28,9 @@ describe Infobip::Twofactor::API do
28
28
  expect(response[:smsStatus]).to eq "MESSAGE_SENT"
29
29
  end
30
30
 
31
- it "should store pin_id value" do
32
- response = subject.send_pin("48790809242")
33
- expect(subject.pin_id).to eq "2B29B71922B37D3C93F8CEBB85B9E3CF"
34
- end
35
-
36
31
  it "should create a valid Verify PIN request, given valid params" do
37
32
  response = subject.send_pin("48790809242")
38
- response = subject.verify_pin("1234")
33
+ response = subject.verify_pin("2B29B71922B37D3C93F8CEBB85B9E3CF", "1234")
39
34
  expect(response[:verified]).to eq true
40
35
  end
41
36
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infobip-twofactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - knx