grand_id_simple 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fd425f3d614ca8058c8545052fffa7ed02a337edfd30e202683b93e3e110733
4
- data.tar.gz: 6c14aa556412aadea0d3ac5ae7958f5f8f241dc6de28778e9364d845f22b128f
3
+ metadata.gz: 499b1d6f461aa4297f3d084494a5311e33632795156cdbd64e8462de97ffb222
4
+ data.tar.gz: 6712b62696b1ce474d5e6fa1dbaeff2b3003babce1e672960f44eb1bc95b2042
5
5
  SHA512:
6
- metadata.gz: dd88789c2f2fa1c78974ef9eefb9ba0dc721d7b8623d6b4798658ed26828bedb98bfb93e57eb52785647238aaa85dc388ff5a94bada9e5534e8d6cbb0b749d65
7
- data.tar.gz: 873c900abe5df8f249c49f4fd33da1f22861d8645bacfdad2c788131ee0b56363ae06c5aaa9022413aef404bdadd47bb59663cc694e58d216a0f31a95dabc401
6
+ metadata.gz: 4475927c8cc7e2247968789f3f17b7a043992afbbfa8465d4fcec75960692f1af07f24793436e93110caab9e1a45023c304b75e6800c35c95634125f1ccf7ecd
7
+ data.tar.gz: 436ca0020510847dcfae27bb38f3c5be407558a21c5e5829c9e4605b7d78d94378d35cd22a5c3c8779df26ad7f45c941f5b2a5ef05ceda3b40d5dfa43f6376a1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grand_id_simple (0.2.0)
4
+ grand_id_simple (1.0.2)
5
5
  sinatra (~> 2.2)
6
6
  typhoeus (~> 1.4)
7
7
  webrick (~> 1.8)
@@ -46,13 +46,9 @@ class FakeGrandIdSimple < GrandIdSimple
46
46
  @server_thread = Thread.start { @server.start }
47
47
  end
48
48
 
49
- def federated_login(callback_url, personal_number: nil)
49
+ def federated_login(**options)
50
50
  @people.concat(@block.call) if @people.empty?
51
- redirect_url = if personal_number && person = @people.find {|p| p.personal_number == personal_number }
52
- FakeGrandIdSimple.add_query_parameter(callback_url, 'grandidsession', person.session_id)
53
- else
54
- FakeGrandIdSimple.add_query_parameter(@base_url, 'callback_url', callback_url)
55
- end
51
+ redirect_url = FakeGrandIdSimple.add_query_parameter(@base_url, 'callback_url', options[:callbackUrl])
56
52
  Login.new(redirect_url: redirect_url)
57
53
  end
58
54
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GrandIdSimple
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.2'
5
5
  end
@@ -37,11 +37,6 @@ class GrandIdSimple
37
37
  keyword_init: true,
38
38
  )
39
39
 
40
- Logout = Struct.new(
41
- :sessiondeleted,
42
- keyword_init: true,
43
- )
44
-
45
40
  def initialize(api_key, service_key, base_url: DEFAULT_BASE_URL)
46
41
  @api_key = api_key
47
42
  @service_key = service_key
@@ -80,8 +75,9 @@ class GrandIdSimple
80
75
  end
81
76
 
82
77
  def logout(session_id)
83
- body = call_api(:Logout, params: {sessionId: session_id})
84
- Logout.new(body)
78
+ call_api(:Logout, params: {sessionId: session_id})
79
+ rescue Error => e
80
+ raise(e) unless e.message['User already logged out']
85
81
  end
86
82
 
87
83
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grand_id_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fonsan