-
facebook.html
271 272 27 27 my $auth_url = $fb_connect->authorize_url( state => $state ); 28 28 if ( $code ) { 29 29 my $local_session = $fb_connect->authenticate( code => $code, state => $state ); 30 if ( ref $local_session && exists $local_session->{id} ) { 31 my $profile = $keeper->{users}->get_profile( id => $local_session->{id} ) if exists $keeper->{users}; 30 if ( ref $local_session eq 'session::Session' && $local_session->id ) { 31 my $profile = $keeper->{users}->get_profile( id => $local_session->id ) if exists $keeper->{users}; 32 32 if ( ref $profile ) { 33 33 unless ( exists $local_session->{avatar} ) { 34 34 my $avatar = $profile->get_image('avatar'); 35 35 $session->{avatar} = ref $avatar && exists $avatar->{filename} ? $avatar->{mini}{'54x54'}{filename} : undef; 36 $keeper->{session}->store_value ( 36 $local_session->set ( 37 37 name => $profile->name_full, 38 38 last_name => $profile->name_family, 39 39 first_name => $profile->name_part, 40 40 avatar => $session->{avatar}, 41 41 ); 42 42 } else { 43 $keeper->{session}->store_value ( 43 $local_session->set ( 44 44 name => $profile->name_full, 45 45 last_name => $profile->name_family, 46 46 first_name => $profile->name_part,