Ability to close a WebOAuthServer without a successful login #2681
gabriel-keith
started this conversation in
Ideas
Replies: 1 comment
-
we'd take a PR with that method on it. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When authorizing a org with WebOAuthServer it's creates a http server on the local machine. Currently the only way to close this server is a successful org authentication or to close the entire application. If the user then decides that they do not wish to add an org this prevents them from entirely stopping the authentication process without closing the application.
If WebOAuthServer had a method such as
then this would provide the ability to programmatically shut down the server.
Also the promise for
authorizeAndSave
should be rejected if the server is prematurely closed without authentication with an error indicating it was programmatically closed.The only alternative I've considered is to leave the server running if the user decided to stop authenticating but this prevents them from authenticating with a different url in the future without restarting the application.
This problem is in the context of an electron app to manage sfdx orgs but may have other applications. I'm currently using a fork of sfdx to provide this functionality and would be happy to create a PR.
Beta Was this translation helpful? Give feedback.
All reactions