Permalink
Browse files

added facebook_login(fb_access_token) to application

  • Loading branch information...
theganyo committed Dec 20, 2012
1 parent 89e25d9 commit 36ef97153a1cea8a648f1a6f9a458dad589d7999
Showing with 15 additions and 2 deletions.
  1. +3 −2 README.md
  2. +12 −0 lib/usergrid/core/application.rb
View
@@ -181,9 +181,10 @@ usergrid_iron/spec/spec_settings.yaml to match.)
## Release notes
-### 0.0.6 (unreleased)
+### 0.0.6
* New features
- 1. iterators can now optionally cross page boundaries, use `collection.follow_cursor.each`
+ 1. iterators can now optionally cross page boundaries, eg. `collection.follow_cursor.each`
+ 2. added facebook_login(fb_access_token) method to application
### 0.0.5
* New features
@@ -37,6 +37,18 @@ def counter(name, other_params={})
self['counters'].get({params: options})
end
+ # login with Facebook token. matching user will be created in usergrid as needed.
+ # usergrid auth token automatically set in auth header for future requests
+ def facebook_login(access_token)
+ params = { fb_access_token: access_token }
+ response = self['auth/facebook'].get({ params: params })
+ self.auth_token = response.data['access_token']
+ user_uuid = response.data['user']['uuid']
+ @current_user = self["/users/#{user_uuid}"].get.entity
+ response
+ end
+
+
private
def _create_user(username, password, email=nil, name=nil, invite=false)

0 comments on commit 36ef971

Please sign in to comment.