Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r10467: LJSUP-8688 (Google integration)

Committer: ailyin
LJSUP-8688 (Google integration)
U   trunk/cgi-bin/LJ/Identity/Google.pm
U   trunk/htdocs/identity/callback-google.bml
Modified: trunk/cgi-bin/LJ/Identity/Google.pm
===================================================================
--- trunk/cgi-bin/LJ/Identity/Google.pm	2011-05-03 07:06:33 UTC (rev 10466)
+++ trunk/cgi-bin/LJ/Identity/Google.pm	2011-05-03 07:29:15 UTC (rev 10467)
@@ -9,32 +9,10 @@
 sub short_code { 'google' }
 
 sub enabled {
-    return LJ::is_enabled('twitter_auth')
+    return LJ::is_enabled('google_auth')
         && $LJ::GOOGLE_OAUTH_CONF;
 }
 
-## GFC version, drop this
-# sub attempt_login {
-#     my ($class, $errs, %opts) = @_;
-# 
-#     $errs ||= [];
-#     my $returl = $opts{'returl'} || $LJ::SITEROOT;
-#     my $returl_fail = $opts{'returl_fail'} || $returl || $LJ::SITEROOT;
-# 
-#     my $fcauth
-#         = LJ::Request->cookie( 'fcauth' . $LJ::GOOGLE_FC_CONF->{'site_id'} );
-# 
-#     die 'no fcauth cookie'
-#         unless $fcauth;
-# 
-#     my $profile = LJ::Client::GoogleFC->fetch_user_profile( {
-#         'fcauth' => $fcauth,
-#     } );
-# 
-#     # callback-google.bml logic goes here, yo
-#     die;
-# }
-
 sub attempt_login {
     my ($class, $errs, %opts) = @_;
 

Modified: trunk/htdocs/identity/callback-google.bml
===================================================================
--- trunk/htdocs/identity/callback-google.bml	2011-05-03 07:06:33 UTC (rev 10466)
+++ trunk/htdocs/identity/callback-google.bml	2011-05-03 07:29:15 UTC (rev 10467)
@@ -45,6 +45,11 @@
         'access_token' => $token_info->{'access_token'},
     } );
 
+    unless ( $userinfo->{'profileUrl'} ) {
+        $title = LJ::Lang::ml('.title.error.no_profile');
+        return LJ::Lang::ml( '.error.no_profile', { 'back' => $returl } );
+    }
+
     my $u = LJ::User::load_identity_user(
         'G', $userinfo->{'id'},
         { 'token_info' => $token_info, 'userinfo' => $userinfo }, 
@@ -53,9 +58,6 @@
 
     LJ::Client::Google->save_access_token( $u, $token_info );
 
-    # do we need to re-initialize every time? either fix this, or drop this
-    # LJ::Identity::Google->initialize_user( $u, $token_info );
-
     # send out a P3P header thing so as to work around IE's
     # unwillingness to receive our cookies while we're in an iframe
     # affects the partner sites authorization

Tags: andy, bml, ljcom, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments