plataforma_social 0.0.32 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,17 +20,23 @@ module PlataformaSocial
20
20
  end
21
21
 
22
22
  if parse_facebook_signed_request && parse_facebook_signed_request['oauth_token']
23
- if !session[:not_verify_facebook_permissions] === true
24
- permissions = @graph.get_object('me', :fields => 'permissions')['permissions']['data'][0]
25
- session[:not_verify_facebook_permissions] = true
26
-
27
- PlataformaSocial.facebook_scope.split(',').each do |permission|
28
- redirect = true unless permissions[permission.strip]
23
+ if parse_facebook_signed_request['expires'] > Time.now.to_i # Se o access_token do usuário não estiver expirado
24
+ if !session[:not_verify_facebook_permissions] === true
25
+ permissions = @graph.get_object('me', :fields => 'permissions')['permissions']['data'][0]
26
+ session[:not_verify_facebook_permissions] = true
27
+
28
+ PlataformaSocial.facebook_scope.split(',').each do |permission|
29
+ redirect = true unless permissions[permission.strip]
30
+ end
29
31
  end
32
+ else
33
+ redirect = true
30
34
  end
31
35
  end
32
36
 
33
- render :text => %|<script type="text/javascript">window.top.location.href="#{@oauth.url_for_oauth_code(:permissions => PlataformaSocial.configuration.facebook_scope)}";</script>| if redirect
37
+ if redirect
38
+ render :text => %|<script type="text/javascript">window.top.location.href="#{@oauth.url_for_oauth_code(:permissions => PlataformaSocial.configuration.facebook_scope)}";</script>|
39
+ end
34
40
  end
35
41
 
36
42
  def load_user_data options = {}
@@ -1,3 +1,3 @@
1
1
  module PlataformaSocial
2
- VERSION = "0.0.32"
2
+ VERSION = "0.0.33"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plataforma_social
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.33
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-21 00:00:00.000000000 Z
12
+ date: 2014-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano