{"_id":"@charamza/next-password-protect","_rev":"4-fda68d0d6799c00f9a73582adc3bcd52","name":"@charamza/next-password-protect","dist-tags":{"latest":"0.0.1-development"},"versions":{"1.6.1":{"name":"@charamza/next-password-protect","version":"1.6.1","license":"MIT","_id":"@charamza/next-password-protect@1.6.1","maintainers":[{"name":"charamza","email":"jenda60@gmail.com"}],"homepage":"https://github.com/storyofams/next-password-protect#readme","bugs":{"url":"https://github.com/storyofams/next-password-protect/issues"},"dist":{"shasum":"b1c31d3e7adb40d077d4a68f4fe602d386583d9a","tarball":"https://registry.npmjs.org/@charamza/next-password-protect/-/next-password-protect-1.6.1.tgz","fileCount":323,"integrity":"sha512-EQfBscUwQ4Waq8sITuEB7PBpuPECFNSCXqQ4T31hLpJddwllzR0yTBR5GgbheW+bK3AR1BA7uIemh/R+cTizmQ==","signatures":[{"sig":"MEQCICS4mVRKm1jRJjL7g5QJ8EBuChArVAwTVyTKuA+gEL+PAiB6KGo8kCV4BUNrIwu5vkQG7FEGjQLPOSiZcnvMe84jpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":661953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDqU+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjfg/+PgBv5mVYQ3ceiq3Ky6qw0XnwzRMSNJprfgvXWJvXkE6D4Uvj\r\n9+pTcLmh755K7tPWufA6X/NvGUustpmu+XaLn0iVbxr50pMGR38oHLttQRGr\r\nbAtF34GM5gG+uV8gduUQjEXpV2AzOdYtavT3zZ8MjEC8UzNAEfWFM428RSsD\r\nn1t3fIcpSQ4VHw8ZHn/TJaDQUcv/48rwZrxrhn2OlasryM1F23lLrHFCq4Qc\r\nrl4FV5Ob6iYNLgGf9Sv5GxE5Lpr74mQKDiZpsWsQnUC3hy/N0vxwG2ERPFpR\r\nFjwNrtIw0dYVCNXEz6pyVVUmkO0r4SY/AwWrZst88d0vteVg/HyW6rIMh2Xb\r\nw8o6PVAQkXTJjWKvW0wMCB3D33iyj2TOmsxyEp4zlF6TA+brV0h+aChfJPRc\r\n3i5Cp08LWFA1yyI0YICATGQPl1vpzvj3133NRn7QeSQ6DSO5TuR8GECfoRDs\r\nQywuCehr6NL13oVOAMpj7Gzzg6r9I7pj56+3kvOMHIgQCcxy+sEDnry0ORHq\r\nViye1l4cjT7xpnZr8IxIcoSPO4PKGfg7exhINb97HU707TL3FXpACT0a5Fxt\r\nuH03Lm4emT/eKaZLV9VuwaRZUO0pSEJb0xFe6/MSubu9FOSuwgUdedoT/nGd\r\ntiwO/Jhf7K34PlZzdfYKtMyCF/pkBiIPbrM=\r\n=SOUF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/src/index.js","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"types":"dist/esm/index.d.ts","config":{"commitizen":{"path":"node_modules/cz-customizable"}},"module":"dist/esm/src/index.js","gitHead":"2ef952742f2c08e00aa91639c0344addcba1eb71","scripts":{"lint":"eslint --ext .ts --ext .tsx ./src","test":"jest --coverage","build":"npm run build-types && npm run bundle","bundle":"rollup -c","commit":"./node_modules/cz-customizable/standalone.js","prettier":"prettier \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|mdx)\"","test:watch":"jest --watch","build-types":"tsc --project tsconfig.build.json","bundle:watch":"rollup -c -w","prepublishOnly":"npm run build","semantic-release":"semantic-release","build-types:watch":"tsc --project tsconfig.build.json --watch"},"_npmUser":{"name":"charamza","email":"jenda60@gmail.com"},"repository":{"url":"git+https://github.com/storyofams/next-password-protect.git","type":"git"},"_npmVersion":"8.5.0","description":"Password protect your Next.js deployments.","directories":{},"jsnext:main":"dist/esm/src/index.js","lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint --fix"]},"sideEffects":false,"_nodeVersion":"16.8.0","dependencies":{"cookie":"^0.4.1","jsonwebtoken":"^8.5.1","safe-compare":"^1.1.4"},"eslintConfig":{"extends":["@storyofams/eslint-config-ams/web"]},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^0.27.1","jest":"26.6.3","next":"11.1.1","husky":"4.3.8","react":"17.0.1","tslib":"2.1.0","eslint":"7.18.0","events":"^3.3.0","rollup":"2.38.5","ts-jest":"26.4.4","ts-node":"^9.1.1","jest-axe":"^4.1.0","prettier":"2.2.1","react-dom":"17.0.1","ts-loader":"8.0.16","@babel/cli":"7.12.13","typescript":"4.1.3","@babel/core":"7.12.13","@types/jest":"26.0.20","@types/node":"14.14.21","lint-staged":"10.5.3","ttypescript":"1.5.12","@types/react":"17.0.0","babel-eslint":"10.1.0","babel-loader":"8.2.2","@types/express":"4.17.11","@commitlint/cli":"11.0.0","@types/jest-axe":"^3.5.1","cz-customizable":"git+https://github.com/storyofams/cz-customizable.git#6.3.1","node-mocks-http":"^1.10.1","@types/react-dom":"17.0.0","isomorphic-fetch":"^3.0.0","semantic-release":"17.3.3","@babel/preset-env":"7.12.13","eslint-plugin-mdx":"^1.8.2","rollup-plugin-svg":"^2.0.0","rollup-plugin-copy":"^3.3.0","@babel/preset-react":"7.12.13","@types/jsonwebtoken":"^8.5.1","@types/safe-compare":"^1.1.0","eslint-plugin-react":"7.22.0","react-test-renderer":"17.0.1","rollup-plugin-clear":"2.0.7","@rollup/plugin-babel":"5.2.3","@testing-library/dom":"7.29.4","eslint-plugin-import":"2.22.1","rollup-plugin-terser":"7.0.2","@testing-library/react":"11.2.3","babel-preset-react-app":"10.0.0","eslint-config-prettier":"7.1.0","eslint-plugin-jsx-a11y":"6.4.1","eslint-plugin-prettier":"3.3.1","jest-styled-components":"^7.0.3","rollup-plugin-analyzer":"4.0.0","rollup-plugin-filesize":"9.1.0","@rollup/plugin-commonjs":"17.1.0","@babel/preset-typescript":"7.12.13","@testing-library/cypress":"7.0.3","@testing-library/jest-dom":"5.11.9","@typescript-eslint/parser":"4.13.0","awesome-typescript-loader":"5.2.1","eslint-plugin-react-hooks":"4.2.0","rollup-plugin-typescript2":"0.29.0","@rollup/plugin-node-resolve":"11.1.1","@semantic-release/changelog":"5.0.1","@testing-library/user-event":"12.6.0","@testing-library/react-hooks":"5.0.0","@zerollup/ts-transform-paths":"1.7.18","eslint-import-resolver-alias":"1.1.2","@storyofams/eslint-config-ams":"1.1.2","tsconfig-paths-webpack-plugin":"^3.3.0","@babel/plugin-transform-runtime":"7.12.15","@commitlint/config-conventional":"11.0.0","@types/testing-library__jest-dom":"5.9.5","@typescript-eslint/eslint-plugin":"4.13.0","rollup-plugin-peer-deps-external":"2.2.4","@babel/plugin-proposal-class-properties":"7.12.13"},"peerDependencies":{"next":">=10.0.0","react":"16.x || 17.x","react-dom":"16.x || 17.x"},"_npmOperationalInternal":{"tmp":"tmp/next-password-protect_1.6.1_1645126973832_0.6304458848974948","host":"s3://npm-registry-packages"}},"0.0.0-development":{"name":"@charamza/next-password-protect","version":"0.0.0-development","license":"MIT","_id":"@charamza/next-password-protect@0.0.0-development","maintainers":[{"name":"charamza","email":"jenda60@gmail.com"}],"homepage":"https://github.com/storyofams/next-password-protect#readme","bugs":{"url":"https://github.com/storyofams/next-password-protect/issues"},"dist":{"shasum":"5eed8514407d54e28ae99c74980eaf0387c99d45","tarball":"https://registry.npmjs.org/@charamza/next-password-protect/-/next-password-protect-0.0.0-development.tgz","fileCount":323,"integrity":"sha512-PWW3sBs1DOea2Y5/0BN7gh4EhKWuaJspHeziufkw5JSObLWW8WypifboWKdpaYdjtdde27Y4G87kXmN9Ui+6Qw==","signatures":[{"sig":"MEUCIDdOKn5v7NQCVwXAuDBEN+Y7ypAL9Jj82wV+hMi5zm8FAiEA59iW0w09znHxNmmhH2G+NOQzMnVM9DFOBkBACL2PY/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":661891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDr+FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogOg/+JKKnBGzF8Mw81gLDGvQoWTTOWB+f7ky8Zs0oFjdwbJ9jvxvt\r\nmveUYT3rk4yUBC3EDFMMdSFIuv8y4xD+1jhhZ+FDgfAFzBwnHumSCKx1dfCh\r\nZts27vf0JSXt4kazdR1Hi1n/XpwxUlZtjG1phSjLmoyeHvvcUEGjG6UDgyk8\r\nxJpv1L+URfNcQyB6HwBEyOtMd8kY8Dxl5ogBHkTZFjzWJli8Ug2v55xunB4a\r\nrSV02bmplJRYdO7Xz2MeDaYwZ98SXP2v1LFmXQJiXR6UpJt4ZB5XvRaXMXZq\r\nqth3DXJqQjOfbIXKiGIb2lGQ0VejqP+/E1so0nDliA2UM8KVd4DoDG7D+7rZ\r\nwIpJorpZIDqc8wHJ3jXLkTFaFpMaUAJVHGdoA2gPd7//XDiKTU8pVmkNImSs\r\nqEY8EjA1K9oL1E222jTiN4MFyXrNeRhd0y0Ina/B8PxOLSsaLlOenZtg6B8i\r\nKkq/x6VV1cFqybdbD5OeXkVx2U2DMx3dvoUufI7eoHkIY0T0n4LT5aQHgpQB\r\nK3HmEUYYNA0ol9EbDtQAPuWcT1cMImHvHqMc5n444o/3ULLYkgg3y7NDLnPB\r\n88dj+E2OuJChwz2rF/cF9gVvrHzzR0XNGJXBrY4t7qIoBz4iRHCxoB2Mqspm\r\n6USKSzGXgYJYg31tTpgjk6aNJ/QdUxPNdBE=\r\n=ZsUg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/src/index.js","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"types":"dist/esm/index.d.ts","config":{"commitizen":{"path":"node_modules/cz-customizable"}},"module":"dist/esm/src/index.js","gitHead":"93c7ae7ead3a1322a642d02ed127fb0c85689207","scripts":{"lint":"eslint --ext .ts --ext .tsx ./src","test":"jest --coverage","build":"npm run build-types && npm run bundle","bundle":"rollup -c","commit":"./node_modules/cz-customizable/standalone.js","prettier":"prettier \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|mdx)\"","test:watch":"jest --watch","build-types":"tsc --project tsconfig.build.json","bundle:watch":"rollup -c -w","prepublishOnly":"npm run build","semantic-release":"semantic-release","build-types:watch":"tsc --project tsconfig.build.json --watch"},"_npmUser":{"name":"charamza","email":"jenda60@gmail.com"},"repository":{"url":"git+https://github.com/storyofams/next-password-protect.git","type":"git"},"_npmVersion":"8.5.0","description":"Password protect your Next.js deployments.","directories":{},"jsnext:main":"dist/esm/src/index.js","lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint --fix"]},"sideEffects":false,"_nodeVersion":"16.8.0","dependencies":{"cookie":"^0.4.1","jsonwebtoken":"^8.5.1","safe-compare":"^1.1.4"},"eslintConfig":{"extends":["@storyofams/eslint-config-ams/web"]},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^0.27.1","jest":"26.6.3","next":"11.1.1","husky":"4.3.8","react":"17.0.1","tslib":"2.1.0","eslint":"7.18.0","events":"^3.3.0","rollup":"2.38.5","ts-jest":"26.4.4","ts-node":"^9.1.1","jest-axe":"^4.1.0","prettier":"2.2.1","react-dom":"17.0.1","ts-loader":"8.0.16","@babel/cli":"7.12.13","typescript":"4.1.3","@babel/core":"7.12.13","@types/jest":"26.0.20","@types/node":"14.14.21","lint-staged":"10.5.3","ttypescript":"1.5.12","@types/react":"17.0.0","babel-eslint":"10.1.0","babel-loader":"8.2.2","@types/express":"4.17.11","@commitlint/cli":"11.0.0","@types/jest-axe":"^3.5.1","cz-customizable":"git+https://github.com/storyofams/cz-customizable.git#6.3.1","node-mocks-http":"^1.10.1","@types/react-dom":"17.0.0","isomorphic-fetch":"^3.0.0","semantic-release":"17.3.3","@babel/preset-env":"7.12.13","eslint-plugin-mdx":"^1.8.2","rollup-plugin-svg":"^2.0.0","rollup-plugin-copy":"^3.3.0","@babel/preset-react":"7.12.13","@types/jsonwebtoken":"^8.5.1","@types/safe-compare":"^1.1.0","eslint-plugin-react":"7.22.0","react-test-renderer":"17.0.1","rollup-plugin-clear":"2.0.7","@rollup/plugin-babel":"5.2.3","@testing-library/dom":"7.29.4","eslint-plugin-import":"2.22.1","rollup-plugin-terser":"7.0.2","@testing-library/react":"11.2.3","babel-preset-react-app":"10.0.0","eslint-config-prettier":"7.1.0","eslint-plugin-jsx-a11y":"6.4.1","eslint-plugin-prettier":"3.3.1","jest-styled-components":"^7.0.3","rollup-plugin-analyzer":"4.0.0","rollup-plugin-filesize":"9.1.0","@rollup/plugin-commonjs":"17.1.0","@babel/preset-typescript":"7.12.13","@testing-library/cypress":"7.0.3","@testing-library/jest-dom":"5.11.9","@typescript-eslint/parser":"4.13.0","awesome-typescript-loader":"5.2.1","eslint-plugin-react-hooks":"4.2.0","rollup-plugin-typescript2":"0.29.0","@rollup/plugin-node-resolve":"11.1.1","@semantic-release/changelog":"5.0.1","@testing-library/user-event":"12.6.0","@testing-library/react-hooks":"5.0.0","@zerollup/ts-transform-paths":"1.7.18","eslint-import-resolver-alias":"1.1.2","@storyofams/eslint-config-ams":"1.1.2","tsconfig-paths-webpack-plugin":"^3.3.0","@babel/plugin-transform-runtime":"7.12.15","@commitlint/config-conventional":"11.0.0","@types/testing-library__jest-dom":"5.9.5","@typescript-eslint/eslint-plugin":"4.13.0","rollup-plugin-peer-deps-external":"2.2.4","@babel/plugin-proposal-class-properties":"7.12.13"},"peerDependencies":{"next":">=10.0.0","react":"16.x || 17.x","react-dom":"16.x || 17.x"},"_npmOperationalInternal":{"tmp":"tmp/next-password-protect_0.0.0-development_1645133700971_0.3907575871361564","host":"s3://npm-registry-packages"}},"0.0.1-development":{"name":"@charamza/next-password-protect","description":"Password protect your Next.js deployments.","version":"0.0.1-development","license":"MIT","main":"dist/cjs/src/index.js","module":"dist/esm/src/index.js","jsnext:main":"dist/esm/src/index.js","types":"dist/esm/index.d.ts","sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"commit":"./node_modules/cz-customizable/standalone.js","test":"jest --coverage","test:watch":"jest --watch","lint":"eslint --ext .ts --ext .tsx ./src","prettier":"prettier \"**/*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|mdx)\"","build":"npm run build-types && npm run bundle","bundle":"rollup -c","bundle:watch":"rollup -c -w","build-types":"tsc --project tsconfig.build.json","build-types:watch":"tsc --project tsconfig.build.json --watch","prepublishOnly":"npm run build","semantic-release":"semantic-release"},"peerDependencies":{"next":">=10.0.0","react":"16.x || 17.x","react-dom":"16.x || 17.x"},"dependencies":{"cookie":"^0.4.1","jsonwebtoken":"^8.5.1","safe-compare":"^1.1.4"},"devDependencies":{"@babel/cli":"7.12.13","@babel/core":"7.12.13","@babel/plugin-proposal-class-properties":"7.12.13","@babel/plugin-transform-runtime":"7.12.15","@babel/preset-env":"7.12.13","@babel/preset-react":"7.12.13","@babel/preset-typescript":"7.12.13","@commitlint/cli":"11.0.0","@commitlint/config-conventional":"11.0.0","@rollup/plugin-babel":"5.2.3","@rollup/plugin-commonjs":"17.1.0","@rollup/plugin-node-resolve":"11.1.1","@semantic-release/changelog":"5.0.1","@storyofams/eslint-config-ams":"1.1.2","@testing-library/cypress":"7.0.3","@testing-library/dom":"7.29.4","@testing-library/jest-dom":"5.11.9","@testing-library/react":"11.2.3","@testing-library/react-hooks":"5.0.0","@testing-library/user-event":"12.6.0","@types/express":"4.17.11","@types/jest":"26.0.20","@types/jest-axe":"^3.5.1","@types/jsonwebtoken":"^8.5.1","@types/node":"14.14.21","@types/react":"17.0.0","@types/react-dom":"17.0.0","@types/safe-compare":"^1.1.0","@types/testing-library__jest-dom":"5.9.5","@typescript-eslint/eslint-plugin":"4.13.0","@typescript-eslint/parser":"4.13.0","@zerollup/ts-transform-paths":"1.7.18","babel-eslint":"10.1.0","babel-loader":"8.2.2","babel-preset-react-app":"10.0.0","cz-customizable":"git+https://github.com/storyofams/cz-customizable.git#6.3.1","eslint":"7.18.0","eslint-config-prettier":"7.1.0","eslint-import-resolver-alias":"1.1.2","eslint-plugin-import":"2.22.1","eslint-plugin-jsx-a11y":"6.4.1","eslint-plugin-mdx":"^1.8.2","eslint-plugin-prettier":"3.3.1","eslint-plugin-react":"7.22.0","eslint-plugin-react-hooks":"4.2.0","events":"^3.3.0","husky":"4.3.8","isomorphic-fetch":"^3.0.0","jest":"26.6.3","jest-axe":"^4.1.0","jest-styled-components":"^7.0.3","lint-staged":"10.5.3","msw":"^0.27.1","next":"11.1.1","node-mocks-http":"^1.10.1","prettier":"2.2.1","react":"17.0.2","react-dom":"17.0.2","react-test-renderer":"17.0.2","rollup":"2.38.5","rollup-plugin-analyzer":"4.0.0","rollup-plugin-clear":"2.0.7","rollup-plugin-copy":"^3.3.0","rollup-plugin-filesize":"9.1.0","rollup-plugin-peer-deps-external":"2.2.4","rollup-plugin-svg":"^2.0.0","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.29.0","semantic-release":"17.3.3","ts-jest":"26.4.4","ts-loader":"8.0.16","ts-node":"^9.1.1","tsconfig-paths-webpack-plugin":"^3.3.0","tslib":"2.1.0","typescript":"4.1.3"},"eslintConfig":{"extends":["@storyofams/eslint-config-ams/web"]},"config":{"commitizen":{"path":"node_modules/cz-customizable"}},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint --fix"]},"repository":{"type":"git","url":"git+https://github.com/storyofams/next-password-protect.git"},"_id":"@charamza/next-password-protect@0.0.1-development","gitHead":"974716ee2089ad64133ec7d58b3c2477a25d5a69","bugs":{"url":"https://github.com/storyofams/next-password-protect/issues"},"homepage":"https://github.com/storyofams/next-password-protect#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-63pOBFBip+o9B9por7T6D1FlwsJ1wgvAJ4otw2sTHZ4F7DJogU5Z4+Np7k9j20V7pedSQkNDdYfko3B/7Y0Okw==","shasum":"98eb8faaa192cdd393ebbc9e0d327a96ca48c9c1","tarball":"https://registry.npmjs.org/@charamza/next-password-protect/-/next-password-protect-0.0.1-development.tgz","fileCount":323,"unpackedSize":661015,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCtQns34fz1vhEiI25EoNUbbzrLmJMMdDVKH0zjOK4LFgIgRleATK8xbjXwR8FwVC+MUS/lNSp8VWTbDfvUEqkusUk="}]},"_npmUser":{"name":"charamza","email":"jenda60@gmail.com"},"directories":{},"maintainers":[{"name":"charamza","email":"jenda60@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/next-password-protect_0.0.1-development_1770999132030_0.23748176797321152"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-17T19:42:53.776Z","modified":"2026-02-13T16:12:12.283Z","1.6.1":"2022-02-17T19:42:54.117Z","0.0.0-development":"2022-02-17T21:35:01.162Z","0.0.1-development":"2026-02-13T16:12:12.174Z"},"bugs":{"url":"https://github.com/storyofams/next-password-protect/issues"},"license":"MIT","homepage":"https://github.com/storyofams/next-password-protect#readme","repository":{"type":"git","url":"git+https://github.com/storyofams/next-password-protect.git"},"description":"Password protect your Next.js deployments.","maintainers":[{"name":"charamza","email":"jenda60@gmail.com"}],"readme":"<p align=\"center\">\n  <h1 align=\"center\">@charamza/next-password-protect</h1>\n  <p align=\"center\">\n    <a aria-label=\"releases\" href=\"https://GitHub.com/storyofams/next-password-protect/releases/\" target=\"_blank\">\n      <img src=\"https://github.com/storyofams/next-password-protect/workflows/Release/badge.svg\">\n    </a>\n    <a aria-label=\"npm\" href=\"https://www.npmjs.com/package/@charamza/next-password-protect\" target=\"_blank\">\n      <img src=\"https://img.shields.io/npm/v/@charamza/next-password-protect\">\n    </a>\n    <a aria-label=\"codecov\" href=\"https://codecov.io/gh/storyofams/next-password-protect\" target=\"_blank\">\n      <img src=\"https://codecov.io/gh/storyofams/next-password-protect/branch/master/graph/badge.svg?token=ZV0YT4HU5H\">\n    </a>\n    <a aria-label=\"stars\" href=\"https://github.com/storyofams/next-password-protect/stargazers/\" target=\"_blank\">\n      <img src=\"https://img.shields.io/github/stars/storyofams/next-password-protect.svg?style=social&label=Star&maxAge=86400\" />\n    </a>\n  </p>\n  <p align=\"center\">Password protect your Next.js deployments. <a href=\"http://next-password-protect.vercel.app/\" target=\"_blank\">View demo</a> (Password is <b>secret</b>)</p>\n</p>\n\n---\n\n[![Preview](https://user-images.githubusercontent.com/19343479/110955791-3da56480-834a-11eb-9e7c-6b17621ba346.png)](https://user-images.githubusercontent.com/19343479/114987129-1a179180-9e95-11eb-9508-6c514f671ca9.mov)\n\n## How it works\n\nThis library adds a password prompt to your Next.js deployment. It consists of two main parts:\n1. Two serverless API routes:\n   - A login route that checks if a password is correct and sets a cookie with a JWT in case it is.\n   - A check route that validates if you have the authorization cookie with a valid JWT.\n2. A HOC ([Higher-Order Component](https://reactjs.org/docs/higher-order-components.html)) that wraps Next.js App and adds a check that validates if you are logged in. If you do, then you can view the app normally; otherwise, you are presented with a password prompt.\n\n**Important**: The recommended use case for this library is in a staging or preview environment. By taking advantage of webpack's `DefinePlugin`, we can make sure this library is only included in certain environments, keeping the production bundle size small.\n\n**This library is NOT meant as a secure password authentication wrapper, but rather as a way to keep nosey people out.**\n\n## Installation\n\n```sh\nyarn add @charamza/next-password-protect\n# or\nnpm install @charamza/next-password-protect\n```\n\n## Usage\n\nThere are 3 steps to enabling password protect: setting a global variable, adding the API routes, and adding the HOC to \\_app.\n\n### Step 1\n\nIn order to be able to take advantage of dead code elimination, it is recommended to add an environment variable like `process.env.PASSWORD_PROTECT`, and enable the library based on that variable. To set this variable, add the following to `next.config.js`:\n\n```javascript\nmodule.exports = {\n  env: {\n    // Add any logic you want here, returning `true` to enable password protect.\n    PASSWORD_PROTECT: process.env.ENVIRONMENT === 'staging',\n  }\n});\n```\n\n### Step 2\n\nAdd two api routes, one with the `loginHandler` and one with the `passwordCheckHandler` api function. You can name them anything, as long as you pass the names to `loginApiUrl` and `checkApiUrl` respectively, in the next step. By default it expects `/login` and `/passwordCheck`.\n\n```javascript\nimport { loginHandler } from \"@charamza/next-password-protect\";\n\nexport default loginHandler(\"YOUR_SECRET_PASSWORD\", {\n  // Options go here (optional)\n  cookieName: \"next-password-protect\",\n});\n```\n\n```javascript\nimport { passwordCheckHandler } from \"@charamza/next-password-protect\";\n\nexport default passwordCheckHandler(\"YOUR_SECRET_PASSWORD\", {\n  // Options go here (optional)\n  cookieName: \"next-password-protect\",\n});\n```\n\n### Step 3\n\nAdd the `withPasswordProtect` HOC to the default export of `App` in `pages/_app.tsx`:\n\n```javascript\nimport { withPasswordProtect } from \"@charamza/next-password-protect\";\n\n// Before: export default App;\nexport default process.env.PASSWORD_PROTECT\n  ? withPasswordProtect(App, {\n    // Options go here (optional)\n    loginApiUrl: \"/login\",\n  })\n  : App;\n```\n\n**Note**: make sure to specify `loginApiUrl` and/or `checkApiUrl` if the api route(s) are not default.\n\n## API\n\n### API routes handlers\n```loginHandler(password: string, options)```\n\nThe options object can contain any of the following options:\n\nOption | Description | Default value\n------ | ----------- | -------------\n`cookieMaxAge`| Cookie Max-Age attribute | `undefined`\n`cookieName`| The name of the authorization cookie | `'next-password-protect'`\n`cookieSameSite`| SameSite cookie attribute | `false`\n`cookieSecure`| Secure flag on the cookie | `process.env.NODE_ENV === 'production'`\n\n```passwordCheckHandler(password: string, options)```\n\nThe options object can contain any of the following options:\n\nOption | Description | Default value\n------ | ----------- | -------------\n`cookieName`| The name of the authorization cookie | `'next-password-protect'`\n\n\n### Next App HOC\n```withPasswordProtect(App: NextApp, options)```\n\nThe options object can contain any of the following options:\n\nOption | Description | Default value\n------ | ----------- | -------------\n`checkApiUrl`| Relative path of the api route handled by `passwordCheckHandler` | `'/api/passwordCheck'`\n`loginApiUrl`| Relative path of the api route handled by `loginHandler` | `'/api/login'`\n`loginComponent`| Supply your own React component to show as login prompt | `LoginComponent`\n`loginComponentProps`| Properties object to customize the login prompt, without overriding the entire component (see below) | `{}`\n`bypassProtection`| Bypass protection for specific routes, decided by callback with `NextRouter` param | `({ route }) => false`\n\nThe `loginComponentProps` object can contain any of the following options:\n\nOption | Description | Default value\n------ | ----------- | -------------\n`backUrl`| Show a link with this URL to go back to main website | `undefined`\n`buttonBackgroundColor`| Login button background color | `'#01EDBC'`\n`buttonColor`| Login button color | `'#111'`\n`logo` | Show a logo above the prompt (img src) | `undefined`\n\n## Advanced\n\n### Custom login component\n\nTo change the default login component, a React component can be supplied to the `withPasswordProtect` HOC. In order for the library to function properly, make sure your login component has password input that is validated by the the api route.\nYou can use `src/hoc/LoginComponent.tsx` as a starting point.\n\n## Caveats\n\nAMP is not yet supported, because the LoginComponent failed AMP validation. On an AMP page, nothing is rendered. This could be fixed by changing LoginComponent to valid AMP.\n","readmeFilename":"README.md"}