{"id":18780,"library":"seneca-local-auth","title":"seneca-local-auth","description":"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.","status":"maintenance","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/mirceaalexandru/seneca-local-auth","tags":["javascript","seneca","auth","plugin"],"install":[{"cmd":"npm install seneca-local-auth","lang":"bash","label":"npm"},{"cmd":"yarn add seneca-local-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add seneca-local-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for authentication framework","package":"seneca-auth","optional":false},{"reason":"peer dependency required for Seneca framework","package":"seneca","optional":false}],"imports":[{"note":"This is a CJS-only plugin; no ESM exports available.","wrong":"import senecaLocalAuth from 'seneca-local-auth'","symbol":"default","correct":"require('seneca-local-auth')"},{"note":"The plugin must be used in conjunction with seneca-auth plugin.","wrong":"","symbol":"seneca.use('auth')","correct":"require('seneca')()\n  .use('auth')\n  .use('local-auth', options)"}],"quickstart":{"code":"const Seneca = require('seneca');\nconst seneca = Seneca();\n\nseneca.use('auth', {\n  redirect: {\n    login: '/login',\n    register: '/register'\n  }\n});\n\nseneca.use('local-auth', {\n  login: {\n    fields: ['username', 'password']\n  },\n  register: {\n    fields: ['username', 'password'],\n    confirm: true\n  }\n});\n\nseneca.act('role:auth, cmd:register', {\n  username: 'admin',\n  password: process.env.PASSWORD || 'secret'\n}, (err, user) => {\n  if (err) console.error(err);\n  else console.log('User registered');\n});\n\nseneca.act('role:auth, cmd:login', {\n  username: 'admin',\n  password: process.env.PASSWORD || 'secret'\n}, (err, login) => {\n  if (err) console.error(err);\n  else console.log('Login successful', login);\n});","lang":"javascript","description":"Demonstrates how to set up and use local authentication with seneca-auth and seneca-local-auth, including user registration and login."},"warnings":[{"fix":"Consider migrating to seneca-auth with a different strategy or updating the plugin code for newer Seneca.","message":"Plugin is only compatible with Seneca 0.8, 0.9 and Node 4, 5. Not updated for newer versions.","severity":"breaking","affected_versions":">=0.1.0 <0.2.0"},{"fix":"Evaluate alternatives or consider forking the project.","message":"Package has not been updated since 2014-2015. Low maintenance.","severity":"deprecated","affected_versions":"*"},{"fix":"Always register 'auth' plugin before 'local-auth'.","message":"Requires seneca-auth as a peer dependency; must call seneca.use('auth') before seneca.use('local-auth').","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install seneca-auth seneca' in your project.","cause":"Missing required peer dependency seneca-auth.","error":"Error: Cannot find module 'seneca-auth'"},{"fix":"Ensure the 'auth' plugin is used before 'local-auth': seneca.use('auth').use('local-auth')","cause":"seneca-auth plugin not registered before using local-auth.","error":"Error: role:auth, cmd:login - No handler for role:auth, cmd:login"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}