1.0.3 • Published 4 years ago

secret-server v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

secret-server

Donate on patreon Build Status codecov node npm version dependencies Status devDependencies Status PRs Welcome GitHub

Secret-server hides your application behind a password

This module will make the application unaccessible until the user enters the correct password

Why?

This module was done with the intent to be used during development stages of an application, in order to be able to demo it to the client but keeping hidden from outsiders.

Installation

npm i secret-server

Usage

import secretServer from 'secret-server'

expressApp.use(cookieSession({
  name: 'session',
  keys: ['key1', 'key2'],
})) // or any other session (express-session for example)
expressApp.use(secretServer(/* configuration object */{
  password: 'test',
  redirect: '/',
  successRedirect: '/success',
})) // this should be done before setting the routes

Please check the tests folder for a more complete working example

Configuration object

All properties are not required

Propertydescriptiondefault
passwordpassword to be usedtest
successRedirectpath to redirect the user after a successful authorizationundefined
redirectpath to redirect the user when not authorizedundefined
filepath to the html file with the user input for authorizationundefined

License

MIT

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago