devise_oauth2_canvas_facebook 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,14 @@ class Devise::FacebookConsumerController < ApplicationController
3
3
  include DeviseOauth2CanvasFacebook::FacebookConsumerHelper
4
4
 
5
5
  def auth
6
+ if !!params[:permission]
7
+ scope = Devise.facebook_permissions + ",#{params[:permission]}"
8
+ else
9
+ scope = Devise.facebook_permissions
10
+ end
11
+
6
12
  url = send("#{resource_name}_fb_callback_url".to_sym)
7
- uri = facebook_client.authorization.authorize_url(:redirect_uri => url , :scope => Devise.facebook_permissions)
13
+ uri = facebook_client.authorization.authorize_url(:redirect_uri => url, :scope => scope)
8
14
  if Devise.facebook_canvas_app
9
15
  render :layout => false, :inline => "<script type='text/javascript' charset='utf-8'>top.location.href='#{uri}';</script>"
10
16
  else
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_oauth2_canvas_facebook
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nina Jansen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-13 00:00:00 +02:00
18
+ date: 2010-10-25 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency