-
-
Notifications
You must be signed in to change notification settings - Fork 32
Don't invalidate access token after each request #50
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
Comments
Seems legit, I'll check that purpose and let you know. |
@pipozzz Something related I've noticed is that it seems that when I provide a username and password, a login call is made to get an auth token... for every single API call. it would be much more efficient if the login call is made only once, when |
Also it would be good if being able to use a user ID and token was documented in the docs. |
Yes. A login call before and a logoff call after. |
I think I understand the reason for this behavior. For example, so that after scripts that are run once many times, there are not many tokens left on the server with access to the account. I also think that you can not call the logoff after each request, but add the |
Also, for login/password authorization you can use What do you think about this? |
I didn't find any serious reason for calling logoff after each call, so I think we can avoid using it. |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
When I authenticate using access token and user ID (rather than username and password), first request passes, but the second and any further request always results in error 401 Unauthorized and my precious access token disappears (from the access token administration in RocketChat UI).
It turned out that it's because after each request a call to RocketChatBase.logoff() is made, which calls the deadly /api/v1/logout endpoint, which does exactly what the documentation says:
Describe the solution you'd like
When authenticating using access token, the library should never call
RocketChatBase.logoff()
on it's own.Describe alternatives you've considered
I don't see any reasonable alternatives.
Additional context
No additional context available.
The text was updated successfully, but these errors were encountered: