{"id":19473304,"url":"https://github.com/ethercreative/yii2-login-attempts-behavior","last_synced_at":"2025-04-25T12:31:31.624Z","repository":{"id":56979672,"uuid":"107994548","full_name":"ethercreative/yii2-login-attempts-behavior","owner":"ethercreative","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-16T06:15:08.000Z","size":11,"stargazers_count":10,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-24T07:53:59.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/ethercreative.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-10-23T14:34:13.000Z","updated_at":"2023-12-23T05:08:52.000Z","dependencies_parsed_at":"2024-11-10T19:18:05.321Z","dependency_job_id":null,"html_url":"https://github.com/ethercreative/yii2-login-attempts-behavior","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":"0.33333333333333337","last_synced_commit":"dd3c76b139973a221371bd5109c66142b27203da"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fyii2-login-attempts-behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fyii2-login-attempts-behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fyii2-login-attempts-behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fyii2-login-attempts-behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethercreative","download_url":"https://codeload.github.com/ethercreative/yii2-login-attempts-behavior/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250817675,"owners_count":21492198,"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-10T19:18:02.588Z","updated_at":"2025-04-25T12:31:30.705Z","avatar_url":"https://github.com/ethercreative.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ⚠️ This repo is no longer being maintained.\n\nYii2 Login Attempts Behavior\n========================\n\nStore login failures, and disable after multiple failures.\n\nInstallation\n------------\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n```sh\ncomposer require ethercreative/yii2-login-attempts-behavior\n```\nor add\n```json\n\"ethercreative/yii2-login-attempts-behavior\": \"*\"\n```\nto the require section of your `composer.json` file.\n\nUsage\n=====\nRun the following migration\n\n    php yii migrate --migrationPath=\"vendor/ethercreative/yii2-login-attempts-behavior/src/migrations\"  --interactive=0\n\nAdd the behavior to your login model.\n\n```php\npublic function behaviors()\n{\n    $behaviors = parent::behaviors();\n\n    $behaviors[] = [\n        'class' =\u003e '\\ethercreative\\loginattempts\\LoginAttemptBehavior',\n\n        // Amount of attempts in the given time period\n        'attempts' =\u003e 3,\n\n        // the duration, for a regular failure to be stored for\n        // resets on new failure\n        'duration' =\u003e 300,\n\n        // the unit to use for the duration\n        'durationUnit' = 'second',\n\n        // the duration, to disable login after exceeding `attemps`\n        'disableDuration' =\u003e 900,\n\n        // the unit to use for the disable duration\n        'disableDurationUnit' =\u003e 'second',\n\n        // the attribute used as the key in the database\n        // and add errors to\n        'usernameAttribute' =\u003e 'email',\n\n        // the attribute to check for errors\n        'passwordAttribute' =\u003e 'password',\n\n        // the validation message to return to `usernameAttribute`\n        'message' =\u003e 'Login disabled',\n    ];\n\n    return $behaviors;\n}\n```\n\nTodo\n====\n\n- [ ] Add cache storage\n- [ ] Add better DB support\n- [ ] Add option for IP (other?) instead of key\n- [ ] Add failure delay option\n- [ ] More customisable\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethercreative%2Fyii2-login-attempts-behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethercreative%2Fyii2-login-attempts-behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethercreative%2Fyii2-login-attempts-behavior/lists"}