Skip to content

Commit ed518d2

Browse files
committed
6.7 compatibility
1 parent d8c759b commit ed518d2

File tree

38 files changed

+356
-243
lines changed

38 files changed

+356
-243
lines changed

.github/workflows/package.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/shopware-cli.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: shopware-cli
2+
on:
3+
pull_request:
4+
push:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
checks:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Install Shopware CLI
19+
uses: shopware/shopware-cli-action@v1
20+
21+
- name: Validation
22+
run: shopware-cli extension validate --full --reporter github .
23+
24+
zip:
25+
uses: shopware/github-actions/.github/workflows/build-zip.yml@main
26+
with:
27+
extensionName: RuneLaenenTwoFactorAuth

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ src/Resources/app/administration/.tmp
55
src/Resources/public/administration/.vite
66
src/Resources/public/administration/assets
77
var/cache
8+
.DS_Store

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ Adds an extra prompt to admin- or customer-accounts in your Shopware 6 website.
1919
- German
2020
- French
2121
- Dutch
22+
- Polish
23+
2224
## Providers
2325
At the moment only Google Authenticator (compatible) apps are supported.
24-
For example Google Authenticator, Authy, LastPass, ...
26+
For example Google Authenticator, Authy, LastPass, Bitwarden, ...
2527

2628
## Installation guide
2729

@@ -40,4 +42,4 @@ bin/build-js.sh
4042
```
4143

4244
## Development
43-
- Use bin/ecs-fix.sh to fix code standard issues.
45+
Keep in mind that 2FA authentication will not work in the development Administration watcher mode.

composer.json

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
11
{
2-
"name": "runelaenen/shopware6-two-factor-auth",
3-
"description": "Two Factor Authentication plugin",
4-
"type": "shopware-platform-plugin",
5-
"license": "MIT",
6-
"version": "7.0.0",
7-
"autoload": {
8-
"psr-4": {
9-
"RuneLaenen\\TwoFactorAuth\\": "src/"
10-
}
2+
"name": "runelaenen/shopware6-two-factor-auth",
3+
"description": "Two Factor Authentication plugin",
4+
"type": "shopware-platform-plugin",
5+
"license": "MIT",
6+
"version": "7.0.0",
7+
"autoload": {
8+
"psr-4": {
9+
"RuneLaenen\\TwoFactorAuth\\": "src/"
10+
}
11+
},
12+
"extra": {
13+
"shopware-plugin-class": "RuneLaenen\\TwoFactorAuth\\RuneLaenenTwoFactorAuth",
14+
"plugin-icon": "src/Resources/config/plugin.png",
15+
"label": {
16+
"de-DE": "Two Factor Authentication plugin",
17+
"en-GB": "Two Factor Authentication plugin"
1118
},
12-
"extra": {
13-
"shopware-plugin-class": "RuneLaenen\\TwoFactorAuth\\RuneLaenenTwoFactorAuth",
14-
"plugin-icon": "src/Resources/config/plugin.png",
15-
"label": {
16-
"de-DE": "Two Factor Authentication plugin",
17-
"en-GB": "Two Factor Authentication plugin"
18-
},
19-
"description": {
20-
"de-DE": "Add extra security to your Shopware 6 shop by enabling Two Factor Authentication. Adds an extra prompt to admin- or customer-accounts in your Shopware 6 website.",
21-
"en-GB": "Add extra security to your Shopware 6 shop by enabling Two Factor Authentication. Adds an extra prompt to admin- or customer-accounts in your Shopware 6 website."
22-
},
23-
"manufacturerLink": {
24-
"de-DE": "https://kraftware.be/",
25-
"en-GB": "https://kraftware.be/"
26-
},
27-
"supportLink": {
28-
"de-DE": "https://github.com/runelaenen/shopware6-two-factor-auth/issues",
29-
"en-GB": "https://github.com/runelaenen/shopware6-two-factor-auth/issues"
30-
}
19+
"description": {
20+
"de-DE": "Add extra security to your Shopware 6 shop by enabling Two Factor Authentication. Adds an extra prompt to admin- or customer-accounts in your Shopware 6 website.",
21+
"en-GB": "Add extra security to your Shopware 6 shop by enabling Two Factor Authentication. Adds an extra prompt to admin- or customer-accounts in your Shopware 6 website."
3122
},
32-
"require": {
33-
"shopware/core": "~6.7.0",
34-
"pragmarx/google2fa": "^8.0",
35-
"bacon/bacon-qr-code": "^3.0"
23+
"manufacturerLink": {
24+
"de-DE": "https://kraftware.be/",
25+
"en-GB": "https://kraftware.be/"
3626
},
37-
"require-dev": {
38-
"phpro/grumphp-shim": "^1.3",
39-
"shopware/platform": "*",
40-
"symplify/easy-coding-standard": "^9.4",
41-
"kubawerlos/php-cs-fixer-custom-fixers": "^3.1"
27+
"supportLink": {
28+
"de-DE": "https://github.com/runelaenen/shopware6-two-factor-auth/issues",
29+
"en-GB": "https://github.com/runelaenen/shopware6-two-factor-auth/issues"
30+
}
31+
},
32+
"require": {
33+
"shopware/core": "~6.7.0",
34+
"pragmarx/google2fa": "^8.0",
35+
"bacon/bacon-qr-code": "^3.0"
36+
},
37+
"require-dev": {
38+
"phpro/grumphp-shim": "^1.3",
39+
"shopware/platform": "*",
40+
"symplify/easy-coding-standard": "^9.4",
41+
"kubawerlos/php-cs-fixer-custom-fixers": "^3.1"
42+
},
43+
"authors": [
44+
{
45+
"name": "Kraftware",
46+
"email": "hello@kraftware.be",
47+
"homepage": "https://www.kraftware.be"
4248
}
49+
]
4350
}

src/Controller/StorefrontTwoFactorAuthController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public function __construct(
3030
private readonly EventDispatcherInterface $dispatcher,
3131
#[Autowire(service: 'Shopware\Core\Checkout\Customer\SalesChannel\LogoutRoute')]
3232
private readonly AbstractLogoutRoute $logoutRoute,
33-
) {}
33+
) {
34+
}
3435

3536
#[Route(path: '/rl-2fa/verification', name: 'frontend.rl2fa.verification', methods: ['GET', 'POST'])]
3637
public function verification(Request $request, SalesChannelContext $context): Response

src/Controller/TwoFactorAuthenticationApiController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public function __construct(
2727
#[Autowire(service: 'Shopware\Storefront\Framework\Routing\Router')]
2828
private readonly RouterInterface $router,
2929
private readonly ConfigurationService $configurationService,
30-
) {}
30+
) {
31+
}
3132

3233
#[Route(path: '/generate-secret', name: 'api.action.rl-2fa.generate-secret', methods: ['GET'])]
3334
public function generateSecret(Request $request): JsonResponse

src/Controller/TwoFactorAuthenticationController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
namespace RuneLaenen\TwoFactorAuth\Controller;
66

77
use RuneLaenen\TwoFactorAuth\Service\ConfigurationService;
8+
use RuneLaenen\TwoFactorAuth\Service\TimebasedOneTimePasswordService;
89
use RuneLaenen\TwoFactorAuth\Service\TimebasedOneTimePasswordServiceInterface;
910
use Shopware\Core\Checkout\Customer\Password\LegacyPasswordVerifier;
1011
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
1112
use Shopware\Core\System\SalesChannel\SalesChannelContext;
1213
use Shopware\Storefront\Controller\StorefrontController;
14+
use Shopware\Storefront\Framework\Routing\Router;
1315
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
1416
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1517
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -25,14 +27,15 @@ class TwoFactorAuthenticationController extends StorefrontController
2527
{
2628
public function __construct(
2729
private readonly ConfigurationService $configurationService,
28-
#[Autowire(service: 'RuneLaenen\TwoFactorAuth\Service\TimebasedOneTimePasswordService')]
30+
#[Autowire(service: TimebasedOneTimePasswordService::class)]
2931
private readonly TimebasedOneTimePasswordServiceInterface $totpService,
30-
#[Autowire(service: 'Shopware\Storefront\Framework\Routing\Router')]
32+
#[Autowire(service: Router::class)]
3133
private readonly RouterInterface $router,
3234
#[Autowire(service: 'customer.repository')]
3335
private readonly EntityRepository $customerRepository,
3436
private readonly LegacyPasswordVerifier $legacyPasswordVerifier,
35-
) {}
37+
) {
38+
}
3639

3740
#[Route(
3841
path: '/rl-2fa/profile/setup',

src/Event/StorefrontTwoFactorAuthEvent.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
readonly class StorefrontTwoFactorAuthEvent
1010
{
11-
public function __construct(private SalesChannelContext $salesChannelContext) {}
11+
public function __construct(private SalesChannelContext $salesChannelContext)
12+
{
13+
}
1214

1315
public function getSalesChannelContext(): SalesChannelContext
1416
{

src/Event/StorefrontTwoFactorCancelEvent.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
readonly class StorefrontTwoFactorCancelEvent
1010
{
11-
public function __construct(private SalesChannelContext $salesChannelContext) {}
11+
public function __construct(private SalesChannelContext $salesChannelContext)
12+
{
13+
}
1214

1315
public function getSalesChannelContext(): SalesChannelContext
1416
{

0 commit comments

Comments
 (0)