{"id":16884615,"url":"https://github.com/timwis/couchdb-password-reset","last_synced_at":"2025-03-20T05:28:05.891Z","repository":{"id":140604705,"uuid":"74463698","full_name":"timwis/couchdb-password-reset","owner":"timwis","description":"Password reset implementation for CouchDB","archived":false,"fork":false,"pushed_at":"2016-11-22T10:59:17.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T07:11:38.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timwis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-22T10:58:27.000Z","updated_at":"2020-01-15T04:03:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"34b5564b-7a45-4d30-bf4c-05532e84abd2","html_url":"https://github.com/timwis/couchdb-password-reset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fcouchdb-password-reset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fcouchdb-password-reset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fcouchdb-password-reset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fcouchdb-password-reset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timwis","download_url":"https://codeload.github.com/timwis/couchdb-password-reset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244557765,"owners_count":20471883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:29:27.986Z","updated_at":"2025-03-20T05:28:05.859Z","avatar_url":"https://github.com/timwis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CouchDB Password Reset\nPassword reset implementation for CouchDB. **Work in progress**\n\n## Usage\n```javascript\nconst http = require('http')\nconst jsonBody = require('body/json')\nconst PasswordReset = require('couchdb-password-reset')\nconst Templates = reqiure('couchdb-password-reset/templates')\n\n// Optionally use included templates by providing them basic info\nconst templates = Templates({\n  siteName: 'My Site',\n  constructResetURL: (token) =\u003e 'http://mysite.com/password-reset' + token,\n  moreInfoURL: 'http://mysite.com/about'\n})\n\nconst passwordReset = PasswordReset({\n  dbURL: 'http://localhost:5984/_users',\n  postmarkServerToken: 'as0d98fasd0f',\n  fromEmail: 'noreply@site.com',\n  resetTokenTemplate: templates.resetToken,\n  notFoundTemplate: templates.notFound\n})\n\nhttp.createServer((req, res) =\u003e {\n  switch (req.url) {\n    case '/reset/init': return (req, res) =\u003e {\n      jsonBody(req, (err, body) =\u003e {\n        const email = body.email\n        passwordReset.init(email, (err) =\u003e {\n          if (err) res.statusCode = err.statusCode\n          res.end()\n        })\n      })\n    }\n    case '/reset/confirm': return (req, res) =\u003e {\n      jsonBody(req, (err, body) =\u003e {\n        const token = body.token\n        const password = body.password\n        passwordReset.confirm(token, password, (err) =\u003e {\n          if (err) res.statusCode = err.statusCode\n          res.end()\n        })\n      })\n    }\n  }\n}).listen(8080)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwis%2Fcouchdb-password-reset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimwis%2Fcouchdb-password-reset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwis%2Fcouchdb-password-reset/lists"}