You can start by creating an Alt store called UserStore which has a user property.
var alt = require('alt');
var UserActions = require('UserActions');
class UserStore{
constructor(){
this.on('init', function(){
this.user = null;
}.bind(this));
this.bindListeners({
updateUser: UserActions.UPDATE_USER
});
}
updateUser(user){
this.user = user;
}
}
module.exports = alt.createStore(UserStore, 'UserStore');
Once the social login is complete (very simple if you use passport) you should dispatch an action UserActions.updateUser(userObject) to populate your store. All the relevant components that are listening to the store will automatically get updated. As usual the data flow is simple :
Action -> Store -> Component
In your UI you can add simple checks like {this.props.user ? 'something' : 'something else'} to show/hide components based on the login state.