• facebook.html

    239 240  
    1 1 <script type="text/javascript">
    2 2 <!--
    3 opener.AuthOnEnd();
    3 opener.location.reload(true);
    4 4 close();
    5 5 //-->
    6 6 </script>
    7
    8 <pre><% Dumper($fb_connect) %></pre>
    7 %#<pre><% Dumper($fb_connect) %></pre>
    9 8 %#<a href="<% $auth_url->as_string %>"><% $auth_url->as_string %></a>
    10 <pre><% Dumper($session) %></pre>
    11
    9 %#<pre><% Dumper($session) %></pre>
    12 10 <%doc>
    13 11
    14 12 Manual redirect:
    15 13
    16 14 use session::AUTH::FaceBook;
    17 my $site = $state->development ? 'www22.zvuki.ru' : 'www.zvuki.ru';
    15 my $site = $state->development ? 'www' : 'www';
    18 16 my $fb_connect = session::AUTH::FaceBook->new(
    19 17 facebook_redirect_uri => 'http://'.$site.'/oauth/facebook.html',
    20 18 );
     
    33 31 if ( $code ) {
    34 32 my $local_session = $fb_connect->authenticate( code => $code, state => $state );
    35 33 if ( ref $local_session && exists $local_session->{id} ) {
    36 my $profile = $keeper->{users}->get_profile( id => $local_session->{id} );
    34 my $profile = $keeper->{users}->get_profile( id => $local_session->{id} ) if exists $keeper->{users};
    37 35 if ( ref $profile ) {
    38 36 unless ( exists $local_session->{avatar} ) {
    39 37 my $avatar = $profile->get_image('avatar');