Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic can't login Request: POST https://api.ionic.io/login No user found by that email

When I try to run any Ionic CLI commands that require login I get a 404 error.

Here's the command line....

? Password: [hidden]
Request: POST https://api.ionic.io/login
Response: 404
Body: 
{ link: null,
  message: 'No user found by that email',
  type: 'NotFound' }

I am definitely entering the correct account details, to ensure this I even created several new accounts at https://dashboard.ionicjs.com/signup, ensured I had validated the email address but still the same error.

(I have just lost 8 hours to this problem so am posting Q&A here to help others.)

like image 654
Martin Joiner Avatar asked Aug 25 '17 16:08

Martin Joiner


1 Answers

This error is due to the fact that Ionic are transitioning to "Ionic Pro" and the CLI needs to use the correct API. The fact that it is attempting to post login requests to api.ionic.io/login shows it's trying to use the old legacy system. You configure which system it uses by setting the backend value in the config.

To Fix:

Firstly, make sure your Ionic CLI is bang up-to-date.

Check the version:

ionic cli -v

It should be 3.9.2 at time of writing. If not update it:

npm install -g ionic@latest 

Now you've got the latest CLI you need to tell it to use "pro" not legacy:

ionic config set backend pro -g

NOTE: When I did this on my machine it did not work at first and I still got the same "No user found" error. I actually had to switch the backend to "legacy" first (using that same command) and then back to "pro". I have no idea why this fixed it but it did.

like image 134
Martin Joiner Avatar answered Nov 09 '22 15:11

Martin Joiner