Registry / auth-security / seneca-local-auth

seneca-local-auth

JSON →
library0.1.2jsnpmunverified

Local authentication plugin for Seneca.js, providing local strategy support via PassportJS. Current stable version 0.1.2. This plugin is designed to be used with seneca-auth and Seneca toolkit. It handles username/password authentication, session management, and user registration. Tested on Seneca 0.8 and 0.9, Node 4 and 5. Key differentiator: integrates seamlessly with seneca-auth's plugin architecture and message patterns for authentication.

npm install seneca-local-auth
INSTALL
IMPORT
SIG · SENECA-LOCAL-AUTH
S
seneca-local-auth
auth-securityjavascriptv0.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
require('seneca-local-auth')
import senecaLocalAuth from 'seneca-local-auth'
This is a CJS-only plugin; no ESM exports available.
seneca.use('auth')
require('seneca')() .use('auth') .use('local-auth', options)
The plugin must be used in conjunction with seneca-auth plugin.

Demonstrates how to set up and use local authentication with seneca-auth and seneca-local-auth, including user registration and login.

const Seneca = require('seneca'); const seneca = Seneca(); seneca.use('auth', { redirect: { login: '/login', register: '/register' } }); seneca.use('local-auth', { login: { fields: ['username', 'password'] }, register: { fields: ['username', 'password'], confirm: true } }); seneca.act('role:auth, cmd:register', { username: 'admin', password: process.env.PASSWORD || 'secret' }, (err, user) => { if (err) console.error(err); else console.log('User registered'); }); seneca.act('role:auth, cmd:login', { username: 'admin', password: process.env.PASSWORD || 'secret' }, (err, login) => { if (err) console.error(err); else console.log('Login successful', login); });
Debug
Known issues
breakingPlugin is only compatible with Seneca 0.8, 0.9 and Node 4, 5. Not updated for newer versions.
fix
Consider migrating to seneca-auth with a different strategy or updating the plugin code for newer Seneca.
affects: >=0.1.0 <0.2.0
deprecatedPackage has not been updated since 2014-2015. Low maintenance.
fix
Evaluate alternatives or consider forking the project.
affects: *
gotchaRequires seneca-auth as a peer dependency; must call seneca.use('auth') before seneca.use('local-auth').
fix
Always register 'auth' plugin before 'local-auth'.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'seneca-auth'
Missing required peer dependency seneca-auth.
fix
Run 'npm install seneca-auth seneca' in your project.
Error: role:auth, cmd:login - No handler for role:auth, cmd:login
seneca-auth plugin not registered before using local-auth.
fix
Ensure the 'auth' plugin is used before 'local-auth': seneca.use('auth').use('local-auth')
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
seneca-authrequiredpeer dependency required for authentication framework
senecarequiredpeer dependency required for Seneca framework
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
seneca-local-auth — npm install seneca-local-auth · libregistry