fbauth 0.9.9.4 → 0.9.9.5

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.
@@ -48,6 +48,7 @@ private
48
48
  session[:fbauth] = auth.session_data
49
49
  return auth
50
50
  else
51
+ logger.warn("Auth parameters in session were stale / invalid")
51
52
  return nil
52
53
  end
53
54
  end
@@ -1,4 +1,5 @@
1
1
  require 'active_support'
2
+ require 'digest/sha2'
2
3
 
3
4
  class FacebookDecoder
4
5
 
@@ -17,7 +17,12 @@ class FacebookGraph
17
17
  http.use_ssl = (uri.scheme == "https")
18
18
  req = Net::HTTP::Get.new(uri.path)
19
19
  response = http.request(req)
20
- json = JSON.parse(response.body)
20
+ throw "Facebook error response #{response.code}" if response.code != 200
21
+ begin
22
+ json = JSON.parse(response.body)
23
+ rescue => e
24
+ throw "Error parsing Facebook response: #{response.body}"
25
+ end
21
26
  ensure
22
27
  http.finish if http.started?
23
28
  end
@@ -37,7 +42,12 @@ class FacebookGraph
37
42
  req = Net::HTTP::Post.new(uri.path)
38
43
  req.set_form_data(options)
39
44
  response = http.request(req)
40
- json = JSON.parse(response.body)
45
+ throw "Facebook error response #{response.code}" if response.code != 200
46
+ begin
47
+ json = JSON.parse(response.body)
48
+ rescue => e
49
+ throw "Error parsing Facebook response: #{response.body}"
50
+ end
41
51
  ensure
42
52
  http.finish if http.started?
43
53
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbauth
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 41
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 9
8
9
  - 9
9
- - 4
10
- version: 0.9.9.4
10
+ - 5
11
+ version: 0.9.9.5
11
12
  platform: ruby
12
13
  authors:
13
14
  - Three Wise Men Inc.
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2011-02-02 00:00:00 -05:00
19
+ date: 2011-02-25 00:00:00 -05:00
19
20
  default_executable:
20
21
  dependencies: []
21
22
 
@@ -53,6 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
53
54
  requirements:
54
55
  - - ">="
55
56
  - !ruby/object:Gem::Version
57
+ hash: 3
56
58
  segments:
57
59
  - 0
58
60
  version: "0"
@@ -61,6 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
63
  requirements:
62
64
  - - ">="
63
65
  - !ruby/object:Gem::Version
66
+ hash: 3
64
67
  segments:
65
68
  - 0
66
69
  version: "0"