.catch(function(err) { notifier.error(err); });
.then(function(data) { notifier.success('User logged in'); window.location = window.location.origin; })
.then(function(data) { notifier.success('Logged out'); window.location = window.location.origin; })
.then(function(data) { notifier.success('User registered'); })