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

Shawn Moore sartak at bestpractical.com
Thu Jun 3 02:44:44 EDT 2010


The branch, master has been updated
       via  441736896619fdbfd33688f12e8baa3c7ffc452c (commit)
      from  af58beb50abf78214540c846859c17dcb0876670 (commit)

Summary of changes:
 lib/Jifty/Plugin/Authentication/Twitter.pm         |    5 ++-
 .../Plugin/Authentication/Twitter/Dispatcher.pm    |   35 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletions(-)
 create mode 100644 lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm

- Log -----------------------------------------------------------------
commit 441736896619fdbfd33688f12e8baa3c7ffc452c
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Jun 3 02:45:26 2010 -0400

    Skeleton dispatcher with /twitter/callback

diff --git a/lib/Jifty/Plugin/Authentication/Twitter.pm b/lib/Jifty/Plugin/Authentication/Twitter.pm
index 8e8b432..53f41a9 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter.pm
@@ -18,7 +18,10 @@ It adds the column C<twitter_name> to your User model.
 =head1 SYNOPSIS
 
 First you must tell Twitter about your application at
-L<http://twitter.com/oauth_clients>. After that, add this plugin, filling in
+L<http://twitter.com/oauth_clients>. Make sure that the Callback URL is set to
+C<http://your.app/twitter/callback>.
+
+After that, add this plugin, filling in
 the consumer key and consumer secret fields in your F<etc/config.yml> under the
 C<framework> section:
 
diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
new file mode 100644
index 0000000..f7c1c7e
--- /dev/null
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::Authentication::Twitter::Dispatcher;
+use Jifty::Dispatcher -base;
+
+=head1 NAME
+
+Jifty::Plugin::Authentication::Twitter::Dispatcher - dispatcher for Twitter plugin
+
+=head1 DESCRIPTION
+
+All the dispatcher rules jifty needs to support L<Jifty::Authentication::Twitter>
+
+=head1 RULES
+
+=head2 before '/twitter/callback'
+
+Handles the login callback. You probably don't need to worry about this.
+
+=cut
+
+before qr'^/twitter/callback' => run {
+    # add action
+
+    if ( Jifty->web->request->continuation ) {
+        Jifty->web->request->continuation->call;
+    }
+    else {
+        redirect '/';
+    }
+};
+
+1;
+

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



More information about the Bps-public-commit mailing list