meteor / meteor-feature-requests

A tracker for Meteor issues that are requests for new functionality, not bugs.
Other
89 stars 3 forks source link

Meteor.loggingInStatus() -> Request to have a more descriptive reactive var for tracking the logging in status of a user #418

Open donstephan opened 3 years ago

donstephan commented 3 years ago

Currently Meteor.loggingIn() returns us a Boolean reactive var depicting if a user is logging in or not. What I propose is a simple addition to this with Meteor.loggingInStatus(). This reactive var will return either a Boolean of false if not logging in or an Object with the type of login method invoked i.e. { type: "resume" }. This would not effect the current implementation of Meteor.loggingIn().

Why? I consistently have used different methods of hiding the UI when logging in with Meteor apps made with React. Most of these methods include hiding the page with CSS if logging in on pages that are not the login page (so you don't get an odd flash of the UI swapping out the different authenticated elements). This works but takes more steps to implement. My goal would be to simplify this process and only hide the UI on certain type of login events, utilizing Meteor.loggingInStatus(). While it's a very small feature, it would make that weird app UI flash easier to fix. A current fix can be done with with Community Method Hooks which works great but since this can be easily implemented into the accounts-base package I would like to propose it.

Happy to implement this myself if approved.

StorytellerCZ commented 3 years ago

I'm for this. @donstephan since you are saying that it is an easy integration, I would say to go ahead and do the PR.