-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "get help" link to the authentication request failed message. #5484
Comments
IB ✅ @nfmohit I added a couple of points about writing tests and bumped the estimate to allow some extra time. |
Brilliant, thank you @techanvil! |
QA Update:
|
@nfmohit @techanvil Not a blocker, but I found one minor caveat in #5635 (review). If you find a few minutes to address this in a PR against |
@felixarntz On it now. Thank you for pointing it out! |
Use `add_query_arg()` for get help URL
@felixarntz #5681 PR has been merged into |
Feature Description
When the request to the authentication proxy fails, we show the wp_die screen with the appropriate message to the user. We need to update that message to include the new "get help" link that leads to the
{proxy}/support/?error_id=request_to_auth_proxy_failed
URL which can be obtained using thegetErrorTroubleshootingLinkURL
selector introduced in #5423.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Setup:: handle_action_setup_start
method should be updated to include the new "get help" link at the end of the error message for failed requests to the authentication server. The "get help" link should lead to the{proxy}/support/?error_id=request_to_auth_proxy_failed
URL.site-kit-wp/includes/Core/Authentication/Setup.php
Lines 133 to 144 in 16a446a
Implementation Brief
includes/Core/Authentication/Setup.php
:__construct
method, create a new class property namedproxy_support_link_url
which should call theget_proxy_support_link_url
method from theAuthentication
class instance (accessible via the$authentication
parameter).site-kit-wp/includes/Core/Authentication/Setup.php
Lines 84 to 94 in a6dd7a4
handle_action_setup_start
method:$oauth_setup_redirect
, create a new variable named$oauth_proxy_failed_help_link
.site-kit-wp/includes/Core/Authentication/Setup.php
Line 133 in a6dd7a4
sprintf
function with:<a>
tag with:href
attribute, value for which should be the first placeholder (%1$s
- the troubleshooting URL).target
attribute, value for which should be_blank
.%2$s
- the Get Help string)./?error_id=request_to_auth_proxy_failed
appeneded to$this->proxy_support_link_url
. The entire URL should be escaped usingesc_url()
.Get Help
(translatable).site-kit-wp/includes/Core/Authentication/Setup.php
Line 139 in a6dd7a4
%s
) should be changed to%1$s
.%2$s
- the get help link) and a full stop.sprintf
function call, which should simply be the$oauth_proxy_failed_help_link
variable.site-kit-wp/includes/Core/Authentication/Setup.php
Line 143 in a6dd7a4
sprintf
function.%s
) should be appended to the existing string followed by a full stop.sprintf
function should be the$oauth_proxy_failed_help_link
variable.Test Coverage
In
tests/phpunit/integration/Core/Authentication/Setup_Test.php
:test_handle_action_setup_start__wp_error
test case to check for the full error message (the first error message in the IB).QA Brief
Sign in with Google
button is clicked. In order to get the error:wp-config.php
file:define( 'WP_HTTP_BLOCK_EXTERNAL', true );
.Sign in with Google
button.Get Help
link, clicking on which should open the relevant support page in a new tab.QA:Eng
site-kit-wp/includes/Core/Authentication/Setup.php
Lines 176 to 192 in fed860f
wp_die()
is called even though thefilter_var()
is truthy.Sign in with Google
button.Get Help
link, clicking on which should open the relevant support page in a new tab.Changelog entry
The text was updated successfully, but these errors were encountered: