plataforma_social 0.0.33 → 0.0.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,12 +21,27 @@ module PlataformaSocial
21
21
 
22
22
  if parse_facebook_signed_request && parse_facebook_signed_request['oauth_token']
23
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]
24
+ if !session[:not_verify_facebook_permissions] == true
25
+ begin
26
+ permissions = @graph.get_object('me', :fields => 'permissions')['permissions']['data'][0]
27
+ session[:not_verify_facebook_permissions] = true
28
+
29
+ PlataformaSocial.facebook_scope.split(',').each do |permission|
30
+ redirect = true unless permissions[permission.strip]
31
+ end
32
+ rescue Koala::Facebook::AuthenticationError
33
+ redirect = true
34
+
35
+ # Remove o signed_request da URL já que ele está expirado e recarrega o objeto do @oauth
36
+ if params[:callback_url].present?
37
+ params[:callback_url].gsub!("signed_request=#{params[:signed_request]}", "")
38
+ elsif request.present?
39
+ request.fullpath.gsub!("signed_request=#{params[:signed_request]}", "")
40
+ else
41
+ PlataformaSocial.facebook_callback_url.to_s.gsub!("signed_request=#{params[:signed_request]}", "")
42
+ end
43
+
44
+ load_oauth
30
45
  end
31
46
  end
32
47
  else
@@ -108,9 +123,11 @@ module PlataformaSocial
108
123
  uri.query,
109
124
  "gm_referral_code=#{URI.encode(params[:gm_referral_code] || '')}",
110
125
  "utm_source=#{URI.encode(params[:utm_source] || '')}",
126
+ "source=#{URI.encode(params[:utm_source] || '')}",
111
127
  "campaign=#{URI.encode(params[:utm_campaign] || '')}",
128
+ "utm_campaign=#{URI.encode(params[:utm_campaign] || '')}",
112
129
  "medium=#{URI.encode(params[:utm_medium] || '')}",
113
- "source=#{URI.encode(params[:utm_source] || '')}"
130
+ "utm_medium=#{URI.encode(params[:utm_medium] || '')}"
114
131
  ].compact.join('&')
115
132
 
116
133
  uri.to_s
@@ -1,3 +1,3 @@
1
1
  module PlataformaSocial
2
- VERSION = "0.0.33"
2
+ VERSION = "0.0.34"
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.33
4
+ version: 0.0.34
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: