Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.41k stars 1.98k forks source link

Task: [Backend] Verify the credentials upon submission, return verification error if they don't #94710

Closed Imran92 closed 2 days ago

Imran92 commented 1 week ago

Details

This issue is only for the backend.

We can probably do it in two ways.

  1. Create an endpoint to verify that the credentials work
  2. Just add a new check in the current submission endpoint (/automated-migration) to make sure the creds work

I suggest we go with option 2 because otherwise we'll need to make two sequential calls for each submission, which will make it slow.

The background job already uses a function to login to the website. We will just reuse that function to login to the user's site. If the logging in doesn't work as expected, we'll return an error. Upon receiving this error, the frontend will show error messages and tell the user to recheck the credentials.

Checklist

Related

No response

Imran92 commented 4 days ago

Diff published D162290-code