@warp-works/warpjs-session-plugin

2.0.6 • Public • Published

WarpJS session plugin

This plugin will handle the login and credentials.

This plugin will inject/work with an user object on req.warpjsUser.

Configuration

Add the following configuration section to your project:

{
  "plugins": [{
    "name": "Session manager",
    "moduleName": "@warp-works/warpjs-session-plugin",
    "path": "/session",
    "type": "session",
    "config": {
      "jwtSecret": "YourJsonWebTokenSecret",
      "jwtCookieName": "NameOfYourJsonWebTokenCookie"
      "roles": {
        "admin": "admin",
        "content": "content"
      },
      "admin": {
        "username": "defaultAdminUsername",
        "password": "bcryptPasswordForDefaultAdmin"
      },
      "casSSO": {
        "enabled": true,
        "urlPrefix": "https://cas-server/sso",
        "userAttribute": "ssoID"
      }
    }
  }]
}
  • casSSO: Add this section if cas SSO is used.
    • enabled: If we should use CAS SSO integration.
    • urlPrefix: CAS SSO url prefix to use.
    • userAttribute: Attribute name added to the account entity (users.entity).

Exposed routes

This plugin exposes the following routes:

  • W2:plugin:session:login To process login.
  • W2:plugin:session:logout To process logout.

Usage

const warpjsSession = require('@warp-works/warpjs-session-plugin');

const sessionMiddlewares = warpjsSession.middlewares(

TODO...

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.63latest
2.0.30fsi
2.0.00node14

Version History

VersionDownloads (Last 7 Days)Published
2.0.63
2.0.51
2.0.40
2.0.30
2.0.20
2.0.11
2.0.00
2.0.0-rc.10
1.2.300
1.2.290
1.2.280
1.2.270
1.2.260
1.2.250
1.2.240
1.2.230
1.2.220
1.2.210
1.2.200
1.2.190
1.2.180
1.2.170
1.2.160
1.2.150
1.2.140
1.2.130
1.2.120
1.2.110
1.2.100
1.2.90
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.0-rc10
0.3.20
0.3.10
0.3.00
0.2.20
0.2.00
0.1.00

Package Sidebar

Install

npm i @warp-works/warpjs-session-plugin

Weekly Downloads

2

Version

2.0.6

License

MIT

Unpacked Size

1.29 MB

Total Files

81

Last publish

Collaborators

  • matt-quoin
  • mficht
  • huuda.tran
  • slama