{"id":18336368,"url":"https://github.com/launchpadlab/lp_resettable","last_synced_at":"2025-04-09T19:55:34.296Z","repository":{"id":74422163,"uuid":"81475007","full_name":"LaunchPadLab/lp_resettable","owner":"LaunchPadLab","description":"Simple password reset logic for Rails Apps","archived":false,"fork":false,"pushed_at":"2017-02-10T21:55:29.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T19:55:23.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LaunchPadLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-02-09T17:16:29.000Z","updated_at":"2017-02-10T21:55:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"dba3f0ce-6b2f-4b8f-bc52-764b9e10f5fd","html_url":"https://github.com/LaunchPadLab/lp_resettable","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/LaunchPadLab%2Flp_resettable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flp_resettable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flp_resettable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flp_resettable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaunchPadLab","download_url":"https://codeload.github.com/LaunchPadLab/lp_resettable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103911,"owners_count":21048245,"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-11-05T20:07:43.063Z","updated_at":"2025-04-09T19:55:34.276Z","avatar_url":"https://github.com/LaunchPadLab.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LP Resettable\nSimple password reset logic for Rails apps. No baked in routing or mailers, just the barebones logic and migration you need to implement resettable logic for your users.\n\n## Installation\nAdd `gem lp_resettable,  github: 'launchpadlab/lp_resettable'` to your Gemfile and run `bundle install`.\n\n## Usage\nFor the purposes of these instructions, I will assume the model you are using is 'User' but it could be anything you want. I will also assume your User model has an 'email' field and virtual attributes for 'password' and 'password_confirmation'\n\n1. Generate a migration to add the required fields to the model of your choice with `bundle exec rails generate lp_resettable:model User`\n2. Run the migration with `bundle exec rails db:migrate`. This adds three columns to your table: `reset_token`, and `reset_sent_at`.\n3. When you want to start the process, assume you have created a `user`, then call `LpResettable::Model.set_reset_token! user`. This will return the token that you can share with the client via email, link, smoke-signals, whatever.\n4. While you are in charge of sending reset instructions, `lp_resettable` still needs to track it, so when you are ready call\n```\nLpResettable::Model.send_send_instructions! user do\n    \u003cinsert your logic here\u003e\nend\n```\nand 'lp_resettable' will take care of the rest.\n\n5. To reset a user's password, call `LpResettable::Model.reset_by_token!(User, reset_token, new_password, new_password_confirmation)`. This will find the user by reset token, update their password and passwword_confirmation fields, and return the user model.\n6. Any errors that pop up along the way, such as trying to reset a non-resettable object, or an expired token, etc..., will throw an `LpResettable::Error`.\n7. To change the global defaults run `bundle exec rails generate lp_resettable:install` to generate an initializer at `../config/initalizers/lp_resettable.rb`. See the initializer for more details.\n\n## Development\n+ `git clone git@github.com:LaunchPadLab/lp_resettable.git`\n+ `bundle install`\n+ Test with `rake`\n\n## Reset those passwords!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchpadlab%2Flp_resettable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchpadlab%2Flp_resettable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchpadlab%2Flp_resettable/lists"}