{"id":19856976,"url":"https://github.com/johnvuko/has_my_secure_password","last_synced_at":"2026-05-14T17:02:04.118Z","repository":{"id":2104374,"uuid":"3045742","full_name":"johnvuko/has_my_secure_password","owner":"johnvuko","description":"A plugin for implement secure password authentication in your model.","archived":false,"fork":false,"pushed_at":"2013-08-05T16:22:58.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T23:46:49.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/johnvuko.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}},"created_at":"2011-12-24T19:07:50.000Z","updated_at":"2014-05-02T12:21:38.000Z","dependencies_parsed_at":"2022-08-27T10:11:39.573Z","dependency_job_id":null,"html_url":"https://github.com/johnvuko/has_my_secure_password","commit_stats":null,"previous_names":["johnvuko/has_my_secure_password"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnvuko/has_my_secure_password","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fhas_my_secure_password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fhas_my_secure_password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fhas_my_secure_password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fhas_my_secure_password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnvuko","download_url":"https://codeload.github.com/johnvuko/has_my_secure_password/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fhas_my_secure_password/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33034788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12T14:17:06.521Z","updated_at":"2026-05-14T17:02:04.077Z","avatar_url":"https://github.com/johnvuko.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"has_my_secure_password\n======================\n\nA plugin for implement secure password authentication in your model with bcrypt.\n\nInstallation\n------------\n\nInclude the gem in your Gemfile:\n\n    gem 'has_my_secure_password', :git =\u003e 'https://github.com/jonathantribouharet/has_my_secure_password'\n\n\nUsage\n-----\n\nIn your migrations:\n\t\n\tclass CreateUsers \u003c ActiveRecord::Migration\n\t\tdef self.up\n\t\t\tcreate_table :users do |t|\n\t\t\t\tt.string :email, :null =\u003e false\n\t\t\t\tt.password\n\t\t\tend\n\t\tend\n\tend\n\t\nCustom migration:\n\n\tclass CreateUsers \u003c ActiveRecord::Migration\n\t\tdef self.up\n\t\t\tcreate_table :users do |t|\n\t\t\t\tt.string :email, :null =\u003e false\n\t\t\t\tt.password :null =\u003e false\n\t\t\tend\n\t\tend\n\tend\n\nMinimal configuration in your model:\n\t\n\tclass User \u003c ActiveRecord::Base\n\t\thas_my_secure_password\n\tend\n\nCustom configuration in your model:\n\t\n\tclass User \u003c ActiveRecord::Base\n\t\thas_my_secure_password(:presence =\u003e false) do |config|\n\t\t\tconfig.has_my_secure_password_field = :username\n\t\tend\n\tend\n\nThe options passed to `has_my_secure_password` are used for `password_digest` field, by default `{:presence =\u003e true}`.\n`password_digest` field is protected for counteract mass-assignment with `attr_protected`.\n`has_my_secure_password_field` is the field used by `authenticate` class method, by default it's `email`.\n\nFor know if the password is good for a user\n\n\tif @user.authenticate(password)\n\t\tflash[:notice] = 'Good password'\n\telse\n\t\tflash[:notice] = 'Bad password'\n\tend\n\t\nFor find a user with the good couple of `has_my_secure_password_field` and `password`\n\n\tuser = User.authenticate(email, password)\n\tif user\n\t\tflash[:notice] = 'Good'\n\telse\n\t\tflash[:notice] = 'Email or password invalid'\n\tend\n\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvuko%2Fhas_my_secure_password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnvuko%2Fhas_my_secure_password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvuko%2Fhas_my_secure_password/lists"}