I ran into this issue after I had to change my password in the sandbox. I just ran this command to fix it:
sfdx force:auth:web:login -a <alias> -d -r https://test.salesforce.com
This will open up your browser to login to the sandbox. I was able to deploy to the org after doing this.
(The -r lets you login to a sandbox. Without it, your browser will ...
I solved it through the following steps-
At the bottom left of your VS Code you will find a small box icon to 'open the org'. Just click on that. Wait till the operation finishes. Then try to deploy again.
No, this would not pass the Security Review, and is inappropriate for a managed package, which should not steal the authentication data of its users. If you want to act on behalf of a user, don't impersonate the user, but ask the user to authorize you to act on their behalf: use an OAuth token with a scope agreed to by the user.
It's pretty easy to setup a ...