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.
@nuxtjs/auth
Advanced tools
Authentication module for Nuxt.js
@nuxtjs/auth
dependency using yarn or npm to your project@nuxtjs/auth
and @nuxtjs/axios
to modules
section of nuxt.config.js
{
modules: [
'@nuxtjs/auth',
// ...Axios module should be included AFTER @nuxtjs/auth
'@nuxtjs/axios'
],
// Default Values
auth: {
user: {
endpoint: 'auth/user',
propertyName: 'user',
resetOnFail: true,
enabled: true,
method: 'GET',
},
login: {
endpoint: 'auth/login',
},
logout: {
endpoint: 'auth/logout',
method: 'GET',
},
redirect: {
notLoggedIn: '/login',
loggedIn: '/'
},
token: {
enabled: true,
type: 'Bearer',
localStorage: true,
name: 'token',
cookie: true,
cookieName: 'token'
}
}
Sets the global settings for store fetch action.
true
)Set the global settings for store login action.
Sets the global settings for store logout action.
auth
middleware is added to a page.no-auth
middleware is added to a page.// ... code ...
// Do a password based login
store.dispatch('auth/login', {
fields: {
username: 'your_username',
password: 'your_password'
}
})
// ... code ...
store.dispatch('auth/logout') // run logout
// ... code ...
store.state.auth.token // get access token
// ... code ...
store.state.auth.user // get user data
// ... code ...
store.getters['auth/loggedIn'] // get login status (true or false)
// ... in nuxt.config.js ...
router: {
middleware: [
'auth', // If user not logged in, redirect to '/login' or to URL defined in redirect property
'no-auth' // If user is already logged in, redirect to '/' or to URL defined in redirect property
]
}
Copyright (c) Nuxt Community
FAQs
Authentication module for Nuxt.js
The npm package @nuxtjs/auth receives a total of 7,948 weekly downloads. As such, @nuxtjs/auth popularity was classified as popular.
We found that @nuxtjs/auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.