{"id":28683742,"url":"https://github.com/akehir/angular-password-checker","last_synced_at":"2025-06-14T03:03:55.556Z","repository":{"id":40432190,"uuid":"173306371","full_name":"akehir/angular-password-checker","owner":"akehir","description":"Mirror of:: https://git.akehir.com/akehir/password-checker \u003e\u003e\u003e\u003e\u003e Check out the example::","archived":false,"fork":false,"pushed_at":"2025-05-29T13:55:51.000Z","size":2787,"stargazers_count":8,"open_issues_count":12,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T01:57:20.051Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://password.akehir.com/","language":"TypeScript","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/akehir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2019-03-01T13:27:13.000Z","updated_at":"2025-05-29T03:51:38.000Z","dependencies_parsed_at":"2023-12-21T00:02:02.381Z","dependency_job_id":"3c660dd4-82ac-4229-8515-bb030232c162","html_url":"https://github.com/akehir/angular-password-checker","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/akehir/angular-password-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akehir%2Fangular-password-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akehir%2Fangular-password-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akehir%2Fangular-password-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akehir%2Fangular-password-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akehir","download_url":"https://codeload.github.com/akehir/angular-password-checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akehir%2Fangular-password-checker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259752030,"owners_count":22905968,"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":"2025-06-14T03:01:13.183Z","updated_at":"2025-06-14T03:03:55.550Z","avatar_url":"https://github.com/akehir.png","language":"TypeScript","readme":"# Angular Pwned Password Checker Directive\n\nProtect your users from re-using a password known to be hacked with this simple Angular directive. Check out the [example page](https://password.akehir.com/) to see how it works. The passwords never leave the browser memory and are not transmitted over the network.\n\n## Getting Started\n\nIf you just want to use the library to verify the passwords given by your users, follow the following 4 simple steps. For contributing, or building the library locally, see the section on [building](#building) the library.\n\nSupported Angular Versions\n| Angular Version  | Password Checker Version  |\n| ---------------- | ------------------------- |\n|  6.x             |  1.0.0                    |\n|  7.x             |  2.2.0                    |\n|  8.x             |  3.0.0                    |\n|  9.x             |  4.0.0                    |\n| 10.x             |  5.0.0                    |\n| 11.x             |  6.0.0                    |\n| 12.x             |  7.0.0                    |\n| 13.x             |  8.0.1                    |\n| 14.x             |  9.0.0                    |\n| 15.x             | 10.0.0                    |\n| 16.x             | 11.0.0                    |\n| 17.x             | 12.0.0                    |\n| 18.x             | 13.0.0 - 13.2.0           |\n| 19.x             | 14.0.0                    |\n| 20.x             | 20.0.0                    |\n\n### Step 1: Install\n\nInstall the npm package.\n\n```\nnpm i @triangular/password-checker\n```\n\n### Step 2: Add to NgModule Imports\n\nThen, add the __PasswordCheckerModule__ to the imports of your app.\n\n_If you're using standalone components, you can skip this step._\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { PasswordCheckerModule } from '@triangular/password-checker';\n\n@NgModule({\n    declarations: [\n    ],\n    imports: [\n      PasswordCheckerModule,\n    ],\n    providers: [],\n    bootstrap: [],\n})\nexport class AppModule { }\n```\n\n### Step 3: Add Directive to an Input\nNow you can use the provided directive __pwnedPasswordValidator__ on your reactive forms, to trigger the validation with the pwned password database whenever the form is being validated.\n\n```html\n\u003cinput\n  pwnedPasswordValidator\n  formControlName=\"password\"\n  type=\"password\"\n\u003e\n```\n\nYou can configure the directive by providing additional input bindings. Currently the API endpoint, the input debounce time, as well as the minimum occurrence of a password to fail the validation are configurable:\n\n```html\n\u003cinput\n  pwnedPasswordValidator\n  pwnedPasswordMinimumOccurrenceForError=\"1\"\n  pwnedPasswordApi=\"https://api.pwnedpasswords.com/range/\"\n  pwnedPasswordApiCallDebounceTime=\"400\"\n  formControlName=\"password\"\n  type=\"password\"\n\u003e\n```\n\nAlternatively, you can configure your module by using the `PasswordCheckerModule.forRoot()` method.\n\n```typescript\n@NgModule({\n  declarations: [\n    AppComponent,\n    ExampleComponent,\n  ],\n  imports: [\n    BrowserModule,\n    FormsModule,\n    ReactiveFormsModule,\n    PasswordCheckerModule.forRoot( {\n      pwnedPasswordApiCallDebounceTime: 1000,\n      pwnedPasswordMinimumOccurrenceForError: 4,\n      pwnedPasswordApi: 'https://api.pwnedpasswords.com/range/',\n    }),\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\n\n### Step 4: Provide Feedback\nDon't forget to provide some feedback to your users:\n\n```html\n\u003cdiv\n*ngIf=\"!form.get('password').pending \u0026\u0026 form.get('password').errors \u0026\u0026 form.get('password').errors.pwnedPasswordOccurrence\"\nclass=\"invalid-feedback\"\u003e\n  \u003ch2\u003eThis password has been seen \n  \u003cspan class=\"invalid-feedback--highlight\"\u003e\n  {{form.get('password').errors.pwnedPasswordOccurrence | number:'1.0-0' }}\n  \u003c/span\u003e\n   times before\u003c/h2\u003e\n  \u003cp\u003eThis password has previously appeared in a data breach and should never be used.\n  If you've ever used it anywhere before, change it!\n  \u003c/p\u003e\n\u003c/div\u003e\n```\n\n## Building\nAs a pre-requisite to build the library, you need to install all the dependencies via `npm install` or `yarn`.\n\n### Building the Library\nBefore the sample app can be run, you need to build the library itself.\n\n```\nnpm run ng -- build password-checker-lib --progress=false\n```\n\n### Building the Sample App\nAfter building the library, it is either possible to build the sample app, via\n\n```\nnpm run ng -- build example-app --prod --progress=false\n```\n\n,or to run the sample app with a local dev server:\n\n```\nnpm run ng -- serve\n```\n\n## Running the tests\n\n### Unit Tests\nThere are not many tests, but those that are can be run with:\n\n```\nnpm run test -- --no-watch --progress=false --code-coverage --browsers ChromeHeadless\n```\n\n### And coding style tests\n\nThe project follows the [angular style guide](https://angular.io/guide/styleguide) and lints with the following command:\n\n```\nnpm run lint\n```\n\n## Built With\n\n* [Angular](https://github.com/angular/angular) - The web framework used\n* [NPM](https://www.npmjs.com/) - Dependency Management\n* [Gitlab](https://git.akehir.com) - Source Control \u0026 CI Runner\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning.\n\n## Authors\n\n* **Raphael Ochsenbein** - *Initial work* - [Akehir](https://github.com/akehir)\n\nSee also the list of [contributors](https://github.com/akehir/angular-password-checker/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgments\n\n* [Pwned Passwords](https://haveibeenpwned.com/Passwords) for providing the API\n* [CloudFlare](https://blog.cloudflare.com/validating-leaked-passwords-with-k-anonymity/) For sponsoring the hosting of the API\n* [angularindepth](https://blog.angularindepth.com/creating-a-library-in-angular-6-87799552e7e5) for a tutorial for creating an angular library\n* [PurpleBooth](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2/) for the readme template\n\n","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Form Validation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakehir%2Fangular-password-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakehir%2Fangular-password-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakehir%2Fangular-password-checker/lists"}