particle-iot/spark-cli

invalid account should not save credentials

Closed this issue · 2 comments

Using spark setup or spark login using an invalid/non-existent account,

1.) User is not prompted to decide whether a new account should be created
2.) email address is stored in the username field but without a valid access token
3.) Perform a spark list and this error message will appear:

Retrieving cores... (this might take a few seconds)
listDevices got error:  invalid_token
Potentially unhandled rejection [2] invalid_token (WARNING: non-Error used)

We should look at not saving any credentials in an event where the login is invalid

This is related to #164 where the error handling caused this problem to occur

closing this by the fix: 6ccbd02