nuxt-website-lock

0.2.1 • Public • Published

nuxt-website-lock

npm version npm downloads Github Actions CI License

📖 Release Notes

Setup

  1. Add nuxt-website-lock dependency to your project
yarn add nuxt-website-lock # or npm install nuxt-website-lock
  1. Add nuxt-website-lock to the modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxt-website-lock',

    // website-lock has to be before axios so axios instance is available at websitelock module
    // to enable validation of token on BE change "enableServerValidation" to true
    ['nuxt-website-lock', {enableServerValidation: false, enabled: true, password: 'superSecretPassword'}],
    '@nuxtjs/axios',
  ]
}

Module options

Option name Description Default value Possible values
enabled whether website lock should be enabled default: null options: true/false
password password which unlocks website default: null any string (will be simply hashed to md5)
formPath url at which the form for website lock will be default: /website-lock any string starting with slash
enableServerValidation whether password should be validated against BE (tailor fitted for personal use, will be expanded upon in later versions) default: false options: true/false
cookieName name of the cookie under which the hashed token will be stored default: websiteLock._token any string, cannot be null
cookie object storing some cookie
cookie.prefix prefix of cookieName being stored default: '' any string, cannot be null
cookie.expires number of days in which the cookie will expire default: 2 any unsigned integer

Todo

  • [ ] better customizability

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) Patrik Jánosdeák

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-website-lock

Weekly Downloads

8

Version

0.2.1

License

MIT

Unpacked Size

19.4 kB

Total Files

11

Last publish

Collaborators

  • truesteps