userapp-io / userapp-angular

AngularJS module that adds user authentication to your app with UserApp.
https://userapp.io
MIT License
233 stars 84 forks source link

user.authenticated not working properly #6

Open JobaDiniz opened 10 years ago

JobaDiniz commented 10 years ago

I think user.authenticated is not working properly, not sure thou, could be something else. When I logged in in my app and close the tab and after some time, like several hours (maybe days, not sure), I open my app again (without closing the browser), the user.get and oauth.connection.search (to ge the facebook image) fails with:

{"error_code":"INVALID_CREDENTIALS","message":"Unable to authenticate as user. Provided token does not exist."}

The user appears to be logged (it can access logged pages) but the app does not work because the login token is not there, so he actually is not logged at all (I think this is what happening, not sure thou).

But then I hit F5 to reload the page or click in other link which the user must be logged, the user is redirected to Login page, and after log in everything works.

PS: I not using the version with the heartbeat disabled yet.

timothyej commented 10 years ago

Thanks for reporting this. I will make sure to investigate it and I will let you know how it goes.

Best, Timothy

timothyej commented 10 years ago

I haven't been able to reproduce this issue. Could you try using the latest version and see if that solves your problem?

Thanks, Timothy

seifip commented 10 years ago

I'm using the PHP widget library and have a similar problem...

Every once in a while, refresh leads to Unable to authenticate as user. and the only fix is to clear cache and cookies and relogin.