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

Check for authentication after config #34

Open
drodil opened this issue Oct 6, 2020 · 1 comment
Open

Check for authentication after config #34

drodil opened this issue Oct 6, 2020 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@drodil
Copy link

drodil commented Oct 6, 2020

When user changes configuration, the tool could check the authentication against the server for example by getting users issues and check if the connection works. If the connection does not work the tool could ask the authentication parameters again or just quit and remove the configuration file. Otherwise the tool just fails abnormally whatever command you run if your credentials don't work, for example the ls command:

/usr/local/lib/node_modules/jira-cli/lib/jira/ls.js:41
          if (!res.ok) {
                   ^

TypeError: Cannot read property 'ok' of undefined
    at /usr/local/lib/node_modules/jira-cli/lib/jira/ls.js:41:20
    at Request.callback (/usr/local/lib/node_modules/jira-cli/node_modules/superagent/lib/node/index.js:704:3)
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/jira-cli/node_modules/superagent/lib/node/index.js:637:10)
    at Object.onceWrapper (events.js:421:26)
    at ClientRequest.emit (events.js:314:20)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
@drodil
Copy link
Author

drodil commented Oct 6, 2020

Actually for me it seems the authentication is working but for some reason it cannot connect to the server. With CURL I can get the issues from the server though. Another issue would be to also check the error returned by superagent instead just checking the result for ok. Anyhow for some reason this does not work (TLS related?)

@mikhaili mikhaili added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants