Bladeren bron

Fix undefined \$redirect_uri in old_g_letter.php

The OAuth callback redirect called filter_var(\$redirect_uri) but
\$redirect_uri was never defined, making the post-auth redirect
always fail. Also registers the URI with the client and sets offline
access, consistent with process_form.php.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Benjamin Harris 2 weken geleden
bovenliggende
commit
ad80eb0ce9
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      old_g_letter.php

+ 4 - 0
old_g_letter.php

@@ -38,9 +38,13 @@ $agent = 'Benjamin Harris';
 $agent_company = 'Agent Company';
 $file_name = $drg . ' - ' . $name . ' - LOA - ' . $today;
 
+$redirect_uri = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
+
 // Set up Google API Client
 $client = new Google\Client();
 $client->setAuthConfig('oauth-credentials.json');
+$client->setAccessType('offline');
+$client->setRedirectUri($redirect_uri);
 $client->setScopes([Google_Service_Drive::DRIVE, Google_Service_Docs::DOCUMENTS]);
 $service = new Google\Service\Drive($client);