Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts cannot run when installed as a node module #3

Closed
oransel opened this issue Jul 31, 2020 · 4 comments · Fixed by #11
Closed

Scripts cannot run when installed as a node module #3

oransel opened this issue Jul 31, 2020 · 4 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request

Comments

@oransel
Copy link

oransel commented Jul 31, 2020

scripts/authorize.js is not structured to run when installed as a node module to be integrated into another app.

Certs are expected to be in the root of the module. This is not ideal for an application.

@oransel
Copy link
Author

oransel commented Jul 31, 2020

It will be great if the oauth life cycle was built as a function/module instead of command line apps.

@knicola
Copy link
Owner

knicola commented Jul 31, 2020

The scripts were only intended to be used for the development of this module, but I can perhaps look into the possibility of writing a separate auth module.

@oransel
Copy link
Author

oransel commented Jul 31, 2020

It will be a nice addition to have the auth handled for the user of the module. Almost all the work is there already. Mostly, the environment variables and cert location can be passed in as function parameters.

@knicola knicola added the enhancement New feature or request label Jul 31, 2020
@knicola knicola self-assigned this Sep 19, 2020
@knicola knicola linked a pull request Sep 19, 2020 that will close this issue
@knicola
Copy link
Owner

knicola commented Sep 19, 2020

The scripts have been removed. Instead 2 new methods will be added to make oauth2 authorization much easier.

  • TDAmeritrade.authorize(): Promise to bootstrap a local web server for oauth2 authorization. Will request access token and update config if authorization is successful.
  • TDAmeritrade.login(): Promise to automatically authorize or refresh the access token depending on whether the access and/or refresh token exist and are not expired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants