-
Notifications
You must be signed in to change notification settings - Fork 232
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
validateUser semantics #43
Comments
How are you expiring the session? |
The session expires by inactivity. I've set the timeout on the backend to 1 minute. After the time out, I click on the logout button on my UI, which at some point calls validateUser() and the promise gets resolved. |
I'm sorry if the documentation isn't clear. The I'll look into the expired session issue. The client should be able to reject the |
Thanks for the clarification, and the kind replies! |
@CarmineM74 - so I actually do have a test case for this, and it is passing. The test is here. I'm assuming that you're using the |
The
Now, after the session has expired I expect the call to For the sake of completeness, these are the versions I'm using right now:
Should you need to peek at the actual code, please feel free to ask. |
Thanks for the step-by-step! I'll try to reproduce. |
This was indeed a bug. I'll push the fix tonight. |
@CarmineM74 - I think this has been resolved. Please update to ng-token-auth version |
Ugh that's a typo - should be ng-token-auth version |
I believe I will be able to test everything today in the afternoon. Will report as soon! Thanks again for your promptness and great work! |
No problem! Thanks for your excellent error reporting 👍 |
I have done the checks and it appears the issue is still present.
Judging from the comments I'd expect that the call to Assuming so, I went to take a look at the code for I believe that to fix the issue, the code should be changed to:
What do you think? Edited: Of course then it should be rethought where to broadcast the |
I think you might be right. I'll check as soon as I can. Thanks! |
@CarmineM74 - I just added the Also, I'm not sure why the tests for this weren't failing like they should have. Can you find anything obviously wrong with these tests? |
Ok, the test should be better now. The |
Hi, |
Hi,
First off thank you for the great work!
I'm having issues understaning how validateUser() is supposed to work. I mean the documentation states that "This method returns a promise that will resolve if a user's auth token exists and is valid".
So I expected that, after a successful login, when the user's session is expired a successive call to validateUser() should find an expired token and emit events accordingly.
This doesn't seem to be the case.
Indeed, when the current session is expired the call to validateUser() will find both existing auth_headers and a user with the flag "signedIn" set to true! There's no roundtrip to the backend to check wether a token is expired or not.
Is that the expected behaviour of validateUser()?
Thanks in advance
The text was updated successfully, but these errors were encountered: