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

Shawn Moore sartak at bestpractical.com
Thu Jun 10 16:51:20 EDT 2010


The branch, master has been updated
       via  660942f0c2c064347686e403a3c54495c3dba567 (commit)
       via  143e073602fe1e6dc85c97b0717255c2026903e7 (commit)
      from  a18ebde2d05bdf611df75b823c8b942cbf9fbb82 (commit)

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

- Log -----------------------------------------------------------------
commit 143e073602fe1e6dc85c97b0717255c2026903e7
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Jun 10 16:52:06 2010 -0400

    Set the screen_name of twitter_user not user

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
index 839373a..9c63fd4 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -111,7 +111,7 @@ on '/twitter/callback' => run {
 
     if ($twitter_account->id) {
         $user->load($twitter_account->user_id);
-        $user->screen_name($screen_name);
+        $twitter_account->screen_name($screen_name);
     }
     else {
         $user->create(

commit 660942f0c2c064347686e403a3c54495c3dba567
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Jun 10 16:52:13 2010 -0400

    Actually log in once we've got a user

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
index 9c63fd4..20afbbe 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -126,6 +126,12 @@ on '/twitter/callback' => run {
         );
     }
 
+    if ($user->id) {
+        my $current_user = Jifty->app_class('CurrentUser')->load($user->id);
+        Jifty->web->current_user($current_user);
+        Jifty->web->session->expires( undef );
+        Jifty->web->session->set_cookie;
+    }
 };
 
 1;

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



More information about the Bps-public-commit mailing list