多个登录bps的客户绑定同一个谷歌广告账号的判断

This commit is contained in:
hgc 2025-01-06 16:30:23 +08:00
parent c8e69a1d26
commit 8cac0252b0

View File

@ -44,8 +44,12 @@ class OAuthController
$googleOAuthService = new GoogleOAuthService();
$tokens = $googleOAuthService->getRefreshToken($code);
if (!isset($tokens['refresh_token'])) {
return $this->errorResponse(300, 'Invalid state parameter');
if (isset($tokens['access_token'])) {
return $this->errorResponse(300, 'Google Ads Account is Authorized');
}
return $this->errorResponse(300, 'Refresh Token getting failed');
} else {
$googleOAuthService->saveRefreshToken($tokens['refresh_token'], $state);
}