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

Logout does not remove online user in Firebase! #6

Open
hughred22 opened this issue Aug 18, 2015 · 1 comment
Open

Logout does not remove online user in Firebase! #6

hughred22 opened this issue Aug 18, 2015 · 1 comment

Comments

@hughred22
Copy link

Your logout code has problem. You are missing the value to pass in $getRecord(). I change the code into follow:
if (onlineUsers) {
var presenceId = UserFactory.getPresenceId();
console.log ("presenceId is " + presenceId);
var user = onlineUsers.$getRecord(presenceId);
console.log ("User is " + user);
onlineUsers.$remove(user);
}

And it remove the user from online user list. But we still have a BIG ISSUE: What if user session expire? It will kick the user out but it will not delete the online user.

I want to know how you use $onAuth to deal with session expire issue. Basically I want to figure out all the best practices to deal with user login, logout, and session management with Firebase and Ionic...

@arvindr21
Copy link
Member

Take a look at: https://www.firebase.com/docs/web/libraries/angular/guide/user-auth.html#section-auth-state for session state detection.

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