| @@ -236,8 +236,9 @@ | ||
| 236 | 236 | 'n' => $nonce, |
| 237 | 237 | ]); |
| 238 | 238 | |
| 239 | 239 | // External host, so wp_safe_redirect() is not applicable here. |
| 240 | + // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- the OAuth proxy is an external host, which wp_safe_redirect() would refuse. | |
| 240 | 241 | wp_redirect(add_query_arg( |
| 241 | 242 | ['action' => 'connect', 'state' => $state], |
| 242 | 243 | self::get_proxy_url() |
| 243 | 244 | )); |
| @@ -360,8 +361,12 @@ | ||
| 360 | 361 | |
| 361 | 362 | update_option('thinkrank_google_token_contract', self::TOKEN_CONTRACT_VERSION); |
| 362 | 363 | delete_option('thinkrank_google_reconnect_required'); |
| 363 | 364 | |
| 365 | + // A fresh authorization may be a different Google account — the cached | |
| 366 | + // Search Console property list must not outlive the account that wrote it. | |
| 367 | + \ThinkRank\API\Integrations_Endpoint::purge_search_console_sites_cache(); | |
| 368 | + | |
| 364 | 369 | // Settings memoizes reads, so a stale empty token from before the |
| 365 | 370 | // connect would otherwise trip the credential check on this request. |
| 366 | 371 | $this->settings_manager = new Settings_Manager(); |
| 367 | 372 | } |
| @@ -429,8 +434,10 @@ | ||
| 429 | 434 | 'google_token_expires_in' => '', |
| 430 | 435 | 'google_token_created' => '', |
| 431 | 436 | 'google_account_connected' => false, |
| 432 | 437 | ], 'integrations'); |
| 438 | + | |
| 439 | + \ThinkRank\API\Integrations_Endpoint::purge_search_console_sites_cache(); | |
| 433 | 440 | |
| 434 | 441 | update_option('thinkrank_google_reconnect_required', $reason); |
| 435 | 442 | } |
| 436 | 443 | |