Skip to content

Instantly share code, notes, and snippets.

@MacoTasu
Created December 7, 2012 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MacoTasu/4230822 to your computer and use it in GitHub Desktop.
Save MacoTasu/4230822 to your computer and use it in GitHub Desktop.
redirect実装したい
ackage Actlog::Controller::Login;
use Ark 'Controller';
use Actlog::Models;
use Try::Tiny;
use JSON::Types;
use Facebook::Graph;
use CGI;
sub index : Path{
my ($self,$c) = @_;
};
my $fb = Facebook::Graph->new(
app_id => '394680190607371',
secret => 'ac41be120cb3cdf08c43817f2c1fa118',
postback => 'http://localhost:5000/article',
);
sub facebook : Local{
my ($self, $c) = @_;
my $uri = $fb->authorize->extend_permissions(qw//)->uri_as_string;
return $c->res->CGI::redirect($uri);  ##ここの書き方がイマイチ...
#return $c->res->redirect($c->res->$uri('/'));
};
sub postback : Local{
my ( $self, $c ) = @_;
$fb->request_access_token( $self->param('code') );
my $me = $fb->fetch('me');
$self->render( 'me', me => $me );
}
__PACKAGE__->meta->make_immutable;
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment