Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@service-paradis/vue-firebase-auth
Advanced tools
A simple light-weight authentication library for Vue.
npm install @service-paradis/vue-firebase-auth
import FirebaseAuth from '@service-paradis/vue-firebase-auth'
Vue.use(FirebaseAuth, {
project: {
apiKey: '<API_KEY>',
authDomain: '<PROJECT_ID>.firebaseapp.com',
databaseURL: 'https://<DATABASE_NAME>.firebaseio.com',
storageBucket: '<BUCKET>.appspot.com',
messagingSenderId: '<SENDER_ID>',
projectId: '<PROJECT_ID>',
}
})
'/login'
const router = new VueRouter();
Vue.use(FirebaseAuth, {
project: {
// ...
},
options: {
authRedirect: '/auth/login'
}
})
// TODO other options
This plugin works with the vue-router
plugin. Setting an auth
meta field in the router mapping section will ensure authenticated access to that route.
const router = new VueRouter();
Vue.use(FirebaseAuth, {
project: {
// ...
},
router
})
true
false
undefined
String
Each route can define it's own specific redirect. NOTE: If not set it will default to the global redirect options.
// TODO roles? Inspiration from https://raw.githubusercontent.com/websanova/vue-auth/master/docs/Privileges.md // TODO usage example
// TODO explain that $firebaseAuth will be available everywhere
<div>
{{ $firebaseAuth.user().displayName }}
</div>
<router-link v-if="!$firebaseAuth.check()"
:to="'/login'">
login
</router-link>
<a v-if="$firebaseAuth.check()"
@:click="$firebaseAuth.logout()">
logout
</a>
email
and password
redirect
parameter which is passed directly to router when registration is successful. (default to '/')
// TODO other typesconst { email, password } = this;
this.$firebaseAuth.register({ email, password })
.then((user) => {
console.log('User created successfully:', user);
// You can create user related record in database here
}).catch((error) => {
console.error('Registration Failed:', error);
// Handle error here
});
email
and password
redirect
parameter which is passed directly to router when login is successful. (default to '/')
// TODO other typesconst { email, password } = this;
this.$firebaseAuth.login({ email, password })
.then((user) => {
console.log('User logged in successfully:', user);
// Some actions on login here
}).catch((error) => {
console.error('Login Failed:', error);
// Handle error here
});
redirect
parameter which is passed directly to router when logout is successful. (default to authRedirect option)this.$firebaseAuth.logout({ redirect = '/signed-out' })
.then(() => {
console.log('User logged out successfully.');
// Some actions on logout here
}).catch((error) => {
console.error('Logout Failed:', error);
// Should not happen, but handle potential error here
});
// TODO split documentation into separate section (files)
FAQs
Vue Authentication with Firebase.
We found that @service-paradis/vue-firebase-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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.