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

Error { data: [], meta: { msg: 'api.err.LoginRequired', rc: 'error' } } #3

Closed
seanmavley opened this issue May 24, 2017 · 6 comments
Closed
Assignees

Comments

@seanmavley
Copy link

After the server keeps running for a while, making a request returns the error:

Error { data: [],
  meta: { msg: 'api.err.LoginRequired', rc: 'error' } }

A simple workaround I'm thinking of is logging in per each transaction.

That's the right way? Or there's a setting somewhere I'm missing?

@delian
Copy link
Owner

delian commented May 25, 2017 via email

@seanmavley
Copy link
Author

My unifi controller is 5.4.15
I'm using Node 7 (I don't know if that matters)
And using the latest of node-unifiapi

This is what I did, by attempting to login each time, however it still brings up the same error: seanmavley/unifi-guest-bundle-check@5f27aa9#diff-bb503f3d9047bcd4a5730559f1e16560R59

I could make it if it see loginrequired to
automatically try to repeat the last login and then to repeat the call?

I don't know if that'll fix it, but if so, that'll be great.

@delian
Copy link
Owner

delian commented May 26, 2017 via email

@seanmavley
Copy link
Author

Thanks for getting in touch.

  1. Here's my node-unifiapi version:
khophi:UnifiGuest$ npm ls node-unifiapi
unifiguest@0.0.0 /home/khophi/Developments/Express/UnifiGuest
└── node-unifiapi@0.0.45 

The only available versions in npm for node-unifapi is 0.0.45, 0.0.44, 0.0.40, 0.0.39, 0.0.38, 0.0.37, 0.0.36, thus I think I have the latest which is 0.0.45.

  1. This is what is Use to connect:
    https://github.com/seanmavley/unifi-guest-bundle-check/blob/master/routes/index.js#L59-L76

And this my credentials:
https://github.com/seanmavley/unifi-guest-bundle-check/blob/master/routes/index.js#L59-L76

  1. Sorry, when I enable debug, I don't see any log messages anywhere, no error logs in console, except the Error { data: [], meta: { msg: 'api.err.LoginRequired', rc: 'error' } }

When I enable the debug where should I see the logs?

seanmavley added a commit to seanmavley/unifi-guest-bundle-check that referenced this issue May 26, 2017
@seanmavley
Copy link
Author

So it seems to be working. Per each transaction, I logout at the end. Thus, any next transaction needs to reauthenticate. Which seems to be working pretty as expected.

I do not know the down side to doing it that way, but at least it gets it working for now.

@delian delian self-assigned this Jun 28, 2017
@seanmavley
Copy link
Author

Could you look into this? Explicitly logging out per each transaction doesn't solve the problem in the long run. Still throws the error:

Error { data: [],
  meta: { msg: 'api.err.LoginRequired', rc: 'error' } }

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

No branches or pull requests

2 participants