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

Shawn Moore sartak at bestpractical.com
Tue Jun 8 16:26:42 EDT 2010


The branch, master has been updated
       via  60426ce4c5e57d1fcece3d7b9764b8cec1c36fe5 (commit)
       via  557f732833689cd83c6cff4239ddb2c1a136ffe4 (commit)
      from  d9edfb3dacc5553a9c515edd24aded01e50d4ab0 (commit)

Summary of changes:
 .../Twitter/Action/LoginViaTwitter.pm              |   15 +++++++++++++++
 .../Plugin/Authentication/Twitter/Dispatcher.pm    |   15 +++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 557f732833689cd83c6cff4239ddb2c1a136ffe4
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Jun 8 16:27:20 2010 -0400

    LoginViaTwitter params

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Action/LoginViaTwitter.pm b/lib/Jifty/Plugin/Authentication/Twitter/Action/LoginViaTwitter.pm
index 7b1388d..30817cd 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Action/LoginViaTwitter.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Action/LoginViaTwitter.pm
@@ -10,6 +10,21 @@ Jifty::Plugin::Authentication::Twitter::LoginViaTwitter
 package Jifty::Plugin::Authentication::Twitter::Action::LoginViaTwitter;
 use base qw/Jifty::Action/;
 
+use Jifty::Param::Schema;
+use Jifty::Action schema {
+    param access_token =>
+        is mandatory;
+
+    param access_secret =>
+        is mandatory;
+
+    param user_id =>
+        is mandatory;
+
+    param screenname =>
+        is mandatory;
+};
+
 =head2 take_action
 
 Logs into the linked account, creating it if it does not already exist.

commit 60426ce4c5e57d1fcece3d7b9764b8cec1c36fe5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Jun 8 16:27:28 2010 -0400

    Create LoginViaTwitter action prepped with the oauthey args

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
index 188b072..74b97f1 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -96,10 +96,17 @@ 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};
+
+    Jifty->web->new_action(
+        class => 'LoginViaTwitter',
+        moniker => 'login_via_twitter',
+        arguments => {
+            access_token  => $response->token,
+            access_secret => $response->token_secret,
+            user_id       => $response->extra_params->{user_id},
+            screen_name   => $response->extra_params->{screen_name},
+        },
+    );
 };
 
 1;

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



More information about the Bps-public-commit mailing list