[Bps-public-commit] jifty-plugin-authentication-twitter branch, master, updated. e1f2be02b2e35c27c7f7725f063260eda2ec5b90

Shawn Moore sartak at bestpractical.com
Tue Jun 8 11:53:14 EDT 2010


The branch, master has been updated
       via  e1f2be02b2e35c27c7f7725f063260eda2ec5b90 (commit)
      from  3966574abdb1669f28ee451c7e96692f665007d3 (commit)

Summary of changes:
 .../Plugin/Authentication/Twitter/Dispatcher.pm    |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit e1f2be02b2e35c27c7f7725f063260eda2ec5b90
Author: Shawn M Moore <sartak at gmail.com>
Date:   Tue Jun 8 11:50:58 2010 -0400

    Pull screen_name and user_id out of the access token response

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
index 0442f23..188b072 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -72,14 +72,14 @@ on '/twitter/login' => run {
 
 on '/twitter/callback' => run {
     my ($plugin) = Jifty->find_plugin('Jifty::Plugin::Authentication::Twitter');
-    my $token = Jifty->web->request->argument('oauth_token');
-    my $secret = Jifty::CAS->key('twitter_oauth' => $token);
+    my $request_token = Jifty->web->request->argument('oauth_token');
+    my $request_secret = Jifty::CAS->key('twitter_oauth' => $request_token);
 
     my $access_token_request = Net::OAuth::AccessTokenRequest->new(
         consumer_key     => $plugin->consumer_key,
         consumer_secret  => $plugin->consumer_secret,
-        token            => $token,
-        token_secret     => $secret,
+        token            => $request_token,
+        token_secret     => $request_secret,
         request_method   => 'POST',
         request_url      => 'http://twitter.com/oauth/access_token',
         signature_method => 'HMAC-SHA1',
@@ -96,7 +96,10 @@ on '/twitter/callback' => run {
     }
 
     my $response = Net::OAuth::AccessTokenResponse->from_post_body($res->content);
-
+    my $access_token = $response->token;
+    my $access_secret = $response->token_secret;
+    my $user_id = $response->extra_params->{user_id};
+    my $screen_name = $response->extra_params->{screen_name};
 };
 
 1;

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list