
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
firewire-angular-auth
Advanced tools
Use this module with https://www.npmjs.com/package/firewire-angular
Install into your public node_modules folder (if this doesn't make sense, check out https://www.npmjs.com/package/firewire).
$ npm install firewire-angular-auth --save
For this module to work - you will need to enable your particular auth method in firebase.
Coming soon - create / delete users
Within your firewire-angular-auth module you should have 2 jade files. Move these to your views folder.
Now you can set up the following firewire route in index.js
router.get('/user/:page', function(req, res, next) {
firewire.wire(req,res,firewire.load,[]);
});
Now when you go to localhost:3000/user/login you'll be greeted with a login screen.
Within node_modules/angular-fire-auth lives controller.js
Just change the route here to redirect to your page of choice.
if(authdata){window.location.assign("/admin/pages");}
script(src="/node_modules/firewire-angular-auth/index.js")
You should also have firebase and firewireModule as dependancies.
var app = angular.module('app', [
"firebase",
"firewireModule",
"firewireAuthModule"
]);
Auth module is now set up :)
app.controller('myController',['$rootScope', function ($rootScope) {
$rootScope.auth.$onAuth(function(authdata){
// Where should we be redirected on auth?
if(authdata){window.location.assign("/some/where");}
else if(!authdata){window.location.assign("/user/login");}
});
}]);
firewire-angular-auth exposes $rootScope.auth which contains the firebase auth data and $rootScope.fwUser (which connects to the fwUser service).
$rootScope.auth lets you check auth state and perform actions based on that state.
$rootScope.fwUser lets you perform all your user actions and get your users data.
fwUser.act(action, provider, id, password, changeParameter)
action : 'login', 'logout', 'changePassword', 'changeEmail', 'passwordReset'
provider : 'password', 'thirdParty','anon'
provider is needed to tell firebase which type of auth we are using eg. email / password, third party, anonymous, ...
id
id is email when using provider : 'password'. It is either 'google', 'facebook', or 'github' if using provider : 'thirdParty'
password - duh
changeParameter
Used when changing an email or password. This is either the new email or password.
Examples
All of these can be done straight from your UI. If doing them within a controller (etc.) remember to inject $rootScope and call $rootScope.fwUser.act()
login with email / password
fwUser.act('login', 'password', email, password);
Anonymous login (Do this in your js)
Remember to inject $rootScope into your controller, service, etc...
$rootScope.fwUser('login', 'anom');
login thirdParty
fwUser.act('login', 'thirdParty', 'google');
logout
fwUser.act('logout');
password reset
fwUser.act('passwordReset');
change password
fwUser.act('changePassword','password', email, oldPassword, newPassword);
change email
fwUser.act('changeEmail','password', oldEmail, Password, newEmail);
If you need to get a user's data you can do either:
app.controller('myController',['$rootScope', function ($rootScope) {
$rootScope.auth.$onAuth(function(authdata){
if(authdata){$rootScope.fwUser.get();}
});
}]);
Or just user $rootScope.user which already does the above.
Either will dip into firebase/users/{id} and return the data object from that node.
$rootScope.auth contains some useful utilities that you can use straight from the UI.
$rootScope.auth.loginStatus can either be 'loggedIn', 'loggedOut', or 'trying'
Trying is useful for when a user can clicked the login button, and is waiting for a response.
$rootScope.auth.alert - Will = 'authAlert' if there is an issue with auth.
$rootScope.auth.alertMsg - Can be plugged in to display the error message.
Example:
.alert.alert-success(ng-show="auth.loginStatus ==='trying'") logging in...
.alert.alert-danger(ng-show="auth.alert ==='autherror'") {{auth.alertMsg}}
This will show a "logging in" message while the authStatus is neither loggedIn or loggedOut.
Furthermore an error message will be displayed if there is an error.
FAQs
firewire | a modular ecosystem for building firebase apps in express.
The npm package firewire-angular-auth receives a total of 6 weekly downloads. As such, firewire-angular-auth popularity was classified as not popular.
We found that firewire-angular-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.