{"_id":"@brightproductions/waterlock-local-auth","_rev":"2-79239bce4acca48ec7c51808ac7b54ee","name":"@brightproductions/waterlock-local-auth","dist-tags":{"latest":"0.1.2-rc2"},"versions":{"0.1.2-rc2":{"name":"@brightproductions/waterlock-local-auth","version":"0.1.2-rc2","description":"local authentication for waterlock","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git+https://github.com/markwbrown/waterlock-local-auth.git"},"keywords":["waterlock","local","authentication","sails"],"devDependencies":{"mocha":"*","should":"*","proxyquire":"*","coveralls":"*","istanbul":"*","jshint":"*"},"dependencies":{"bcrypt":"^5.0.0","lodash":"~3.10.0","moment":"~2.10.6","nodemailer":"1.4.0","jade":"~1.11.0","jwt-simple":"~0.3.0","node-uuid":"~1.4.2"},"author":{"name":"Mark Brown","email":"mark@brightproductions.com"},"contributors":[{"name":"Mark Brown","email":"mark@brightproductions.com"},{"name":"David Rivera","email":"david.r.rivera193@gmail.com"}],"license":"MIT","bugs":{"url":"https://github.com/markwbrown/waterlock-local-auth/issues"},"homepage":"https://github.com/markwbrown/waterlock-local-auth","preferGlobal":false,"engines":{"node":">=0.10"},"directories":{"lib":"lib","test":"test"},"gitHead":"ef59a178668bc87f543d54de2eac58597769ccb8","_id":"@brightproductions/waterlock-local-auth@0.1.2-rc2","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-raDTtc+jzb11fu1/UmHEBBwAa/Y/CHY98Ekyc775bXqqD4UiVbsD5mkRrfGxHepP0udiM+L+Q/tAB6eXD9XsGQ==","shasum":"3d9884dca6390f0c3e4f760fee9175385eae6420","tarball":"https://registry.npmjs.org/@brightproductions/waterlock-local-auth/-/waterlock-local-auth-0.1.2-rc2.tgz","fileCount":30,"unpackedSize":30819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKfKkCRA9TVsSAnZWagAA79UP/1a42/XgH8p1iATot2TM\nwX41wKyf+4jdpvQ3VgOcr8lIBPoJ93Kgs6Rz8k53Qz8YtenyPuxof+Kzk0ad\nWc0vJ40X+zKYnRMtooDtQbFUfKrldFrNx0Ju/GRxP24q/WsjTHyweA5ggMB8\n5nV0anxtMN1yEOykw5fV3UOXTRlnaMAtPHmMnYpoy3IAAsjmX/3Ce5DPUt5M\n48MYMFC6/JnlVvZw6pJHaLeoAli+0dWoO/ESkcnghd+//FvWuD2FzF5Rfs8w\nNz0ppkAVtBJsuIZ7dl5oAXh1K33f78WNR1EHr6N1ABFr8YdNsTcQnsykHMPJ\njYvXy/VsXu4OB1rOrVVmzB1C1sOAM2HLYuVvve6UhxLwWZTWm21WelR11G/L\n3CHXyedX6nobAsYBhOM5nrLXoT8IAeMy/j5ghIORKRL8M/OL3CqtemujRUjC\nl4yZlGaCS5OXFZy6X4SpS+xBDWD4KccPYauQnOiX3VuzXvg4fR69xn4cjl8N\nl08GkHVbdy0W690ao++mVThBtTP1FUU9EIFKYg5E6tw1FYqe3JhJ6N2eRQ6H\n+j9cNlMkWyKxMEEtSQrKf+W0tgU045wEfmTkISA2CjADbkSi+kELiRvTh8Bh\nwDyXbKjb+krBdUJmsoDhEOI0V3pei8H+8Yadf72WkWWiArGyNVbp+E7nIlIg\nhfBs\r\n=pNgX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP4g2LsZGkTWEVBt7Baq5pl9By2/Ex2WeeUYSnPBRcygIgB30qPXQycNoBxszlN2+iedfLzvB8da9PB8x/5beKUSk="}]},"maintainers":[{"name":"_mark_","email":"mark@brightproductions.com"}],"_npmUser":{"name":"_mark_","email":"mark@brightproductions.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/waterlock-local-auth_0.1.2-rc2_1596584612436_0.08996523234502196"},"_hasShrinkwrap":false}},"time":{"created":"2020-08-04T23:43:32.186Z","0.1.2-rc2":"2020-08-04T23:43:32.578Z","modified":"2022-04-04T20:40:26.656Z"},"maintainers":[{"email":"brian@brightproductions.com","name":"bpwebdesign"},{"email":"mark@brightproductions.com","name":"_mark_"}],"description":"local authentication for waterlock","homepage":"https://github.com/markwbrown/waterlock-local-auth","keywords":["waterlock","local","authentication","sails"],"repository":{"type":"git","url":"git+https://github.com/markwbrown/waterlock-local-auth.git"},"contributors":[{"name":"Mark Brown","email":"mark@brightproductions.com"},{"name":"David Rivera","email":"david.r.rivera193@gmail.com"}],"author":{"name":"Mark Brown","email":"mark@brightproductions.com"},"bugs":{"url":"https://github.com/markwbrown/waterlock-local-auth/issues"},"license":"MIT","readme":"# Waterlock Local Auth\n\nwaterlock-local-auth is a module for [waterlock](http://waterlock.ninja/)\nproviding a local authentication method for users either based on username or email.\n\n## Usage\n\n```bash\nnpm install waterlock-local-auth\n```\n\nset the following option in your `waterlock.js` config file\n\n```js\nauthMethod:[\n\t{\n\t\tname: \"waterlock-local-auth\",\n\t\tpasswordReset: {\n\t\t\ttokens: boolean, // object containing information regarding password resets\n\n\t\t\t// object containing information about your smtp server, see nodemailer\n\t\t\tmail: {\n\t\t\t\toptions: string, // how it is use te transport method, see nodemailer\n\t\t\t\tfrom: string, // the from address\n\t\t\t\tsubject: string, // the email subject for password reset emails\n\t\t\t\tforwardUrl: string // the url to send the user to after they have clicked the password reset link in their inbox (e.g. a form on your site which POST to `/auth/reset`)\n\t\t\t},\n\n\t\t\t// object containing template information for the reset emails\n\t\t\ttemplate:{\n\t\t\t\tfile: string, // the relative path to the `jade` template for the reset emails\n\t\t\t\tvars: object, // object containing any vars you want passed to the template for rendering\n\t\t\t}\n\t\t},\n\t\tcreateOnNotFound: boolean // should local auth try to create the user on a failed login attempt, good if you do not want to implement a registration form.\n\t}\n]\n```\n\n## Auth Model\nLocal auth adds the following attributes onto the Auth model\n\n```js\n  email: {\n    type: 'email',\n    unique: true\n  },\n  password: {\n    type: 'STRING',\n    minLength: 8\n  },\n  resetToken: {\n    model: 'resetToken'\n  }\n```\nwith the way waterlock is designed and this model you can override any of these attributes, also if you want to use a username instead of an email address you can drop in the `username` attribute which is a signification key causing local auth to use that to authenticate.\n\n## Password reset\nWaterlock uses [nodemailer](http://www.nodemailer.com/) to send password reset emails. The options in the config file are applied to nodemailer as such\n```js\nvar mail = config.passwordReset.mail;\nnodemailer.createTransport(mail.protocol, mail.options);\n```\n\nif you choose to go with this option then a user upon visiting the url `/auth/reset` with a post param of `email` will receieve an email at that address with the reset url. This url upon clicked with be validated against the server to ensure it's still within the time window allotted for a password reset. If so will set the `resetToken` session variable. After this if you have set a `forwardUrl` in your `waterlock.js` config file the user will be forwarded to this page.\n\nIf you want to take advantage of the built in reset itself have the page you sent your user to above `POST` to `/auth/reset` with the post param of `password` If all is well a password reset will be issued.\n\n## Template\nYou can customize the email template used in the password reset via the template file defined in `config/waterlock.js` this template file is rendered with the fun and dynamic `jade` markup, the view var `url` is generated and passed to it when a user requests and password reset. You can customize this template to your liking and pass any other view vars you wish to it via the `vars` options in the js file.\n\nYour user can simply try to login to `/login` if the user is not found one will be created using [waterlines](https://github.com/balderdashy/waterline) `findOrCreate` method\n","readmeFilename":"README.md"}