{"id":18840595,"url":"https://github.com/bitexpert/sylius-force-login","last_synced_at":"2025-08-02T01:10:01.982Z","repository":{"id":215659285,"uuid":"739442879","full_name":"bitExpert/sylius-force-login","owner":"bitExpert","description":"Force Customer Login Plugin for Sylius","archived":false,"fork":false,"pushed_at":"2025-07-20T15:13:46.000Z","size":164,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-20T16:27:19.802Z","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/bitExpert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2024-01-05T15:22:19.000Z","updated_at":"2025-07-20T15:12:39.000Z","dependencies_parsed_at":"2024-04-06T07:23:27.675Z","dependency_job_id":"61074967-8cf9-4038-bc09-588dcf71fa29","html_url":"https://github.com/bitExpert/sylius-force-login","commit_stats":null,"previous_names":["bitexpert/sylius-force-login"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/bitExpert/sylius-force-login","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fsylius-force-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fsylius-force-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fsylius-force-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fsylius-force-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitExpert","download_url":"https://codeload.github.com/bitExpert/sylius-force-login/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fsylius-force-login/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268322414,"owners_count":24231819,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"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-08T02:48:13.974Z","updated_at":"2025-08-02T01:10:01.956Z","avatar_url":"https://github.com/bitExpert.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Force Login Plugin for Sylius\n\n[![Build Status](https://github.com/bitExpert/sylius-force-login/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/bitExpert/sylius-force-login/actions)\n[![installs on Packagist](https://img.shields.io/packagist/dt/bitexpert/sylius-force-login-plugin)](https://packagist.org/packages/bitexpert/sylius-force-login-plugin/)\n[![Mastodon Follow](https://img.shields.io/mastodon/follow/109408681246972700?domain=https://rheinneckar.social)](https://rheinneckar.social/@bitexpert)\n\nThe **Force Login** Plugin for *Sylius* allows you to restrict which pages a visitor is\nable to see. Visitors get redirected to the login page if the page is not marked visitable.\nThe **Force Login** Module for *Sylius* is especially useful for merchants serving only a specific\ngroup of users, e.g. enterprise related business partners and need to ensure that only those users are\nable to browse the website or the product catalog.\n\n## Features:\n* Force your guest visitors to log in first (or register), before allowing them to visit your pages and catalog\n* Administration: Manage the whitelist rules by the GUI in the administration area\n* Whitelisting: Define url rules as pattern to define which pages guest visitors can visit without logging in first\n* Multistore-Support: Define if whitelist rules either apply globally or for specific stores\n\n## Requirements:\n* PHP 8.2 or higher\n* Sylius 2.0 or higher\n\n## Installation\n\n1. Install the plugin via Composer\n```bash\ncomposer require bitexpert/sylius-force-login-plugin\n```\n\n2. Enable the plugin\n```php\n\u003c?php\n# config/bundles.php\nreturn [\n    // ...\n\n    BitExpert\\SyliusForceCustomerLoginPlugin\\BitExpertSyliusForceCustomerLoginPlugin::class =\u003e ['all' =\u003e true],\n];\n```\n\n3. Import config\n```yaml\n# config/packages/_sylius.yaml\nimports:\n    # ...\n\n    - { resource: \"@BitExpertSyliusForceCustomerLoginPlugin/Resources/config/config.yml\" }\n    \n    # ...\n```\n\n4. Import routing\n```yaml\n# config/routes/bitexpert_sylius_force_login.yaml\nbitexpert_sylius_forcelogin:\n  resource: \"@BitExpertSyliusForceCustomerLoginPlugin/Resources/config/admin_routing.yml\"\n  prefix: '/%sylius_admin.path_name%'\n```\n\n5. Update your database schema\n```bash\nphp bin/console doctrine:migrations:diff\nphp bin/console doctrine:migrations:migrate\n```\n\n# User Guide\n\n## How to use\nThe usage of the **Force Login** Module for *Sylius* is applied implicitly by redirecting visitors\nif the called URI does not match any configured whitelisted url rules.\n\n### Whitelisting\n\nWhitelisting is based upon the usage of rules. The strategy selection defines how the rules are interpreted, [details are listed below](#strategies).\nThe following example shows, how to add a whitelist entry for the homepage (startpage).\n\nIn Sylius Admin navigate to Configuration \u003e Force Login and use the *Create* button to create a new entry.\n\n- Enter **Homepage** into the text field below the **Label** label.\n- Enter **/** into the text field beside from the **Url Rule** label.\n- Select the channel from the channel list below the **Channel** label which the rule should be active for.\n\nUse the **Create** button to save the entry. After being redirected to the **Overview Grid**, the new\nentry should appear to the list.\n\n## How to configure\n\n### Strategies\n\n#### Static\nRule is used as a literal value and will be added onto the base url for matching. This is default behaviour.\n\n#### RegEx\nRule is based on [regular expression](https://en.wikipedia.org/wiki/Regular_expression), and will be used for looking up matching anywhere in the current url.\n\n#### Negated RegEx\nBased on the RegEx strategy, but negates the result. Helpful if only a few pages should be restricted.\n\n### Add custom strategy\n\nThe strategy configuration is meant to be extensible. You can create an own strategy by creating a new class that\nimplements the `\\BitExpert\\SyliusForceCustomerLoginPlugin\\Model\\StrategyInterface` interface. Your custom class needs\nto be registered as a service and be annotated with `#[AsUrlStrategy]`.\n\n## Tests\n\nYou can run the unit tests with the following command (requires dependency installation):\n\n    ./vendor/bin/phpunit\n\n## Contribution\nFeel free to contribute to this module by reporting issues or create some pull requests for improvements.\n\nTo run the Test Application included in the repo, refer to the [Sylius Test Application](https://docs.sylius.com/sylius-plugins/plugins-development-guide/testapplication) docs.\nIf you are using [DDEV](https://www.ddev.com) you can run the following command to bootstrap the Test Application in Docker: \n```bash\nddev start \u0026\u0026 ddev bootstrap\n```\n\n## License\nThe **Force Login** Module for *Sylius* is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitexpert%2Fsylius-force-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitexpert%2Fsylius-force-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitexpert%2Fsylius-force-login/lists"}