Catalog npm
Back to packageRELEASE DETAILS

0.0.1

npm

2max-express-authenticate

Simply authentication for express based on Sequelize.

Published17 Dec 2017
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

Express authenticate

Simply authentication for express based on Sequelize.

Install

npm i 2max-express-authenticate --save

Configuration

const express = require('express');
const app = express();
const auth = require('2max-express-authenticate');

async function main(app) {
  // Declare auth + configure for persistence
  const util = await auth(app, {
    'persistence': {
      'host': process.env.MYSQL_HOST,
      'user': process.env.MYSQL_USER,
      'password': process.env.MYSQL_PASSWORD,
      'database': process.env.MYSQL_DATABASE,
      'dialect': 'mysql'
    }
  });

  // Secure yours routes with auth
  util.secure([
    '/admin',
    '/dashboard',
    ...
  ]);

  // Override connection method for send custom results
  util.override({
    'login': (req, res) => {
      res.send('Congrats');
     },
     'logout': (req, res) => {
       res.send('OUT');
     },
     'signup': (req, res) => {
       res.send('Good job mother fucker men');
     }
  });
}

app.listen(80);

Route

MethodendpointBody
POST/signup{username, password}
POST/login{username, password}
GET/logoutN/A

Features

  • Crypt password with bcrypt
  • Login, logout and signup (cookies + session)
  • Persist data (according to sequelize compatibility)
  • Give array with route to check session for each route
  • Enable middlewares for set response from /login, /logout and /signup

Todo

  • Add roles checking (bitmask)
  • Secure route according to roles
  • User can add role

Downloads & popularity

2downloads
7-day window · source-reported counts21 Oct 2026
210
2026-10-21: 2 · observed 2026-10-21T19:28:44.8376551Z
21 Oct21 Oct

npm · 1 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2122026-10-21T19:28:44.8376551Z

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
bcrypt
Environment
{
  "local_name": "bcrypt",
  "alias": false,
  "peer_metadata": null
}
^1.0.3runtime
body-parser
Environment
{
  "local_name": "body-parser",
  "alias": false,
  "peer_metadata": null
}
^1.18.2runtime
cookie-parser
Environment
{
  "local_name": "cookie-parser",
  "alias": false,
  "peer_metadata": null
}
^1.4.3runtime
express
Environment
{
  "local_name": "express",
  "alias": false,
  "peer_metadata": null
}
^4.16.2runtime
express-session
Environment
{
  "local_name": "express-session",
  "alias": false,
  "peer_metadata": null
}
^1.15.6runtime
sequelize
Environment
{
  "local_name": "sequelize",
  "alias": false,
  "peer_metadata": null
}
^4.28.5runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-iMcFAdoibxOkqlzMlzz/TXrvLYhtmJW/pF5pgrkIrif914p9EjcdFFVqBlTn340LcA/XKOzBjxpcIgEIKxm5qQ==",
  "shasum": "4da5ea8f2c4fcb3f8c0b1e2ce65613278e1a11e8",
  "tarball": "https://registry.npmjs.org/2max-express-authenticate/-/2max-express-authenticate-0.0.1.tgz",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDauitxiRkDKRHk053U1BFw7kDaqBUiQ2pB977KH3TuWgIhAIJo2itNBV1BqOvR98QWuVChacBWVevQLEfI25W7IUHs"
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:15 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:47a32ecb714eaa04c68c7a5362db2671cc4a445f568f54f2e65e99bd570c9f2a

Other collected versions

0.0.12225 Dec0.0.12125 Dec0.0.1225 Dec0.0.1122 DecView all collected versions →