{"_id":"@alexseitsinger/protected-route","_rev":"1-707e0dfac84cc147b1e828a3f266398d","name":"@alexseitsinger/protected-route","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alexseitsinger/protected-route","version":"0.1.0","description":"A react route that redirects to a different path when the user is not authenticated.","main":"dist/main.js","homepage":"https://github.com/alexseitsinger/protected-route#readme","author":{"name":"Alex Seitsinger","email":"alexseitsinger@gmail.com","url":"https://www.alexseitsinger.com"},"license":"BSD-2-Clause","repository":{"type":"git","url":"https://github.com/alexseitsinger/protected-route.git"},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.6.0","babel-loader":"^7.1.5","babel-plugin-emotion":"^9.2.10","babel-plugin-transform-react-remove-prop-types":"^0.4.13","babel-preset-env":"^1.7.0","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","enzyme":"^3.7.0","enzyme-adapter-react-16":"^1.6.0","jest":"^23.6.0","react-dom":"^16.6.1","react-router":"^4.3.1","webpack":"^4.16.1","webpack-cli":"^3.1.0"},"dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","react-router-dom":"^4.2.2"},"scripts":{"build":"./node_modules/.bin/webpack --config=webpack.config.js","test":"./node_modules/.bin/jest test"},"_id":"@alexseitsinger/protected-route@0.1.0","dist":{"shasum":"c00637859d8e2882e3a957972827564efdbcbbce","tarball":"https://registry.npmjs.org/@alexseitsinger/protected-route/-/protected-route-0.1.0.tgz","integrity":"sha512-SjMsQUeXLsE0MsgWisxlmn1GohdzA2NyJVEmnzmzM8G3sDSjo7SEH3uCq5xuXq8OD5KOYSoumtw6YvxZepwmGA==","fileCount":5,"unpackedSize":52497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6hhrCRA9TVsSAnZWagAA6yEP/iC6wMpJU0JaloZ6RoEP\n+DY4Q2/urgdXxC6Y/U1Eh5wEeLUT4VeJMlxtMtbTpCIbknq4VQCyfJjlGYxR\nzbwE//dH3yxpVw2gDVPrqPQ4lHW5BAK41I9+9bfqf8IiGZfNMlF3grBYSxZ1\nhTxZY7c58qWVj+rw+QUE/YR6QlwfQyfDqBsJlHQI3QmsvhjfNasRCLWIL9cu\nbIVZWTaSyey1+6Nbp2pxm87ONdmh1XNS7FsCK1rMKRBMDYQUnHvf8IdRL5Qo\n0FCi7MfS+cwRjz+n3kKqZw+Mop4h+UggKqZyzCGMH1VqsFgq0JoWj0q+5vJ6\nqczElUXVUHhp6I5nc2LnbzgUJ7zknR9EIxfuNHy6wpu2rtAfbvQLH2AgbvDI\nIQ/zaL1iTjlqnT9bMjieIghrEZskGAmXrmBBt5W7q0H5hs16l/oZnrnLKYdb\nMM1pFEIcqE7GOqTGn6ZG4N1IdhKzIjRrvpuCmyaXZnTUTN30p45k1u/Bl33Q\nTD2DZN0XgydnKGCbSjop3yYlor3z3YFuDax4Ud+iOu0VneFM1hUPVPGcEks7\nxnnT3rCSo4yciMVLx0KybaPUqh3jdCHeQA9oLkbsm17s3ml5O7DFwzXZ/Oxy\nh6sVx3xVfEuiNcbxP8m+xp4lre74k8QaFmm9pbN681WnYRZB26VBPQRYmqwU\nnU8i\r\n=gwpp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvx2eeYbxZKiF88fNg0/ue6UsoEY+4P1Z7T4+ke5dB3AiAHFVbX0w9uKLw7M2fs34OdYrTCqA3xWVTWH4ktNlHEbA=="}]},"maintainers":[{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"}],"_npmUser":{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protected-route_0.1.0_1542068330443_0.5976425340080316"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-13T00:18:50.290Z","0.1.0":"2018-11-13T00:18:50.647Z","modified":"2022-04-04T12:41:36.004Z"},"maintainers":[{"name":"alexseitsinger","email":"alexseitsinger@gmail.com"}],"description":"A react route that redirects to a different path when the user is not authenticated.","homepage":"https://github.com/alexseitsinger/protected-route#readme","repository":{"type":"git","url":"https://github.com/alexseitsinger/protected-route.git"},"author":{"name":"Alex Seitsinger","email":"alexseitsinger@gmail.com","url":"https://www.alexseitsinger.com"},"license":"BSD-2-Clause","readme":"# Protected Route\n\n## Description\n\nA react route that redirects to a different path when the user is not authenticated.\n\n## Props\n\n-   component - (Node, Required) - The component to render when the user is authenticated.\n-   path - (String, Required) - The string to match for the route.\n-   redirectPath - (String, Required) - The path to navigate to when the user is not authenticated.\n-   isAuthenticated - (Boolean, Required) - True or false if the user is authenticated.\n\n## Usage\n\n```javascript\nimport React from \"react\"\nimport { Switch } from \"react-router-dom\"\nimport ProtectedRoute from \"@alexseitsinger/protected-route\"\n\nimport HomePage from \"../pages/home\"\n\nconst ConnectedProtectedRoute = connect((state) => {\n\treturn {\n\t\tisAuthenticated: state.auth.isAuthenticated\n\t}\n})(ProtectedRoute)\n\nexport default (\n\t<Switch>\n\t\t<ConnectedProtectedRoute\n\t\t\tpath={\"/home\"}\n\t\t\tcomponent={HomePage}\n\t\t\tredirectPath={\"/\"}\n\t\t/>\n\t</Switch>\n)\n```\n","readmeFilename":"README.md"}