Wp-calypso: Login: Jetpack Connect flows require retries with the new login

Created on 6 Jul 2017  路  1Comment  路  Source: Automattic/wp-calypso

With the new Calypso login, when attempting to go through any Jetpack Connect flow as a non-logged in user, the connection flow will fail after a couple of automated retries and will prompt for a manual retry. After retrying, it succeeds in connecting, and redirects to the plans page as expected.

With the old wp-login, no retry is needed.

To reproduce, make sure you are testing on staging (proxied) and:

  • Make sure you're not logged into WordPress.com.
  • Go to https://wordpress.com/jetpack/connect/
  • Input the URL of a fresh Jetpack site (new, clean .org site with Jetpack installed and activated that has never been connected) in the connection form.
  • You are presented with the signup form. Click the login link at the bottom.
  • You'll be prompted to log in (the new login form). Do it.
  • Connection flow continues, and you'll see it retries automatically, then fails, prompting for a new manual retry.
  • Try the above steps for production (non-proxied). The retry will not happen.

cc @fabianapsimoes @stephanethomas

Jetpack Login [Type] Bug

Most helpful comment

I was able to reproduce this issue in development on master setting the following in the browser's console:

localStorage.setItem( 'debug', 'calypso:jetpack-connect:*' )

It looks like this a problem with the _wp_nonce sent to the /jetpack-blogs/:site_id:/jetpack-login API endpoint:

calypso:jetpack-connect:actions Trying Jetpack login. +39s
calypso:jetpack-connect:actions Authorize error +228ms Error: Could not verify your request.
calypso:jetpack-connect:actions retrying auth +14ms
calypso:jetpack-connect:actions retryAuth +11ms

The Could not verify your request error is indeed returned by the API with not_verified as error code (which is very easy to locate in our server code since it's the only occurrence). I'll keep investigating tomorrow to identify the root cause.

>All comments

I was able to reproduce this issue in development on master setting the following in the browser's console:

localStorage.setItem( 'debug', 'calypso:jetpack-connect:*' )

It looks like this a problem with the _wp_nonce sent to the /jetpack-blogs/:site_id:/jetpack-login API endpoint:

calypso:jetpack-connect:actions Trying Jetpack login. +39s
calypso:jetpack-connect:actions Authorize error +228ms Error: Could not verify your request.
calypso:jetpack-connect:actions retrying auth +14ms
calypso:jetpack-connect:actions retryAuth +11ms

The Could not verify your request error is indeed returned by the API with not_verified as error code (which is very easy to locate in our server code since it's the only occurrence). I'll keep investigating tomorrow to identify the root cause.

Was this page helpful?
0 / 5 - 0 ratings