Revision 557

Date:
2016/03/29 09:17:33
Author:
ahitrov
Revision Log:
VK Auth upgrade
backend html code update

Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/session/comps/www/oauth/facebook.html

     
    1 <!DOCTYPE html>
    2 <head>
    1 3 <script type="text/javascript">
    2 4 <!--
    3 5 opener.location.reload(true);
    4 6 close();
    5 7 //-->
    6 8 </script>
    9 </head>
    10 </html>
    7 11 <%doc>
    8 12
    9 13 Manual redirect:
  • utf8/plugins/session/comps/www/oauth/vkontakte.html

     
    1 <!DOCTYPE html>
    2 <head>
    1 3 <script type="text/javascript">
    2 4 <!--
    3 5 opener.location.reload(true);
    4 6 close();
    5 7 //-->
    6 8 </script>
    9 </head>
    10 </html>
    7 11 <%doc>
    8 <pre><% Dumper($user_info) %></pre>
    9 </%doc>
    10 <%doc>
    11 12
    12 13 use LWP::UserAgent;
    13 14 use JSON::XS;
  • utf8/plugins/session/lib/session/AUTH/VKontakte.pm

     
    56 56 my ($class, %config) = @_;
    57 57 my $self = bless {}, $class;
    58 58
    59 $self->{vk_authorize_url} = 'http://oauth.vk.com/authorize';
    59 $self->{vk_authorize_url} = 'https://oauth.vk.com/authorize';
    60 60 $self->{vk_access_token_url} = 'https://oauth.vk.com/access_token';
    61 61 $self->{vk_user_info_url} = 'https://api.vk.com/method/getProfiles';
    62 62
     
    76 76 my $go = URI->new( $self->{vk_authorize_url} );
    77 77 $go->query_param( client_id => $self->{vk_app_id} );
    78 78 $go->query_param( scope => $self->{vk_scope} || '' );
    79 $go->query_param( display => 'page' );
    79 80 $go->query_param( response_type => 'code' );
    81 $go->query_param( v => '5.44' );
    80 82 $args{redirect_uri} ||= $self->{vk_redirect_uri};
    81 83 for ( keys %args ) {
    82 84 $go->query_param( $_ => $args{$_} );
    83 85 }
    86 warn "VK AUTH URL: $go\n" if $DEBUG;
    84 87 my $local_session = $session || $keeper->{session}->get_session;
    85 88 $local_session->set( vk_redirect_url => $self->{vk_redirect_uri} );
    86 89 return $go;