Skip to content

Commit b2342aa

Browse files
committed
Configure 2fa bundle
1 parent 0d96857 commit b2342aa

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

config/packages/security.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ security:
3434
target: dashboard
3535
switch_user: true
3636

37+
two_factor:
38+
auth_form_path: mfa_login
39+
check_path: mfa_login_check
40+
3741
# activate different ways to authenticate
3842
# https://symfony.com/doc/current/security.html#the-firewall
3943

4044
# Easy way to control access for large sections of your site
4145
# Note: Only the *first* access control that matches will be used
4246
access_control:
43-
# - { path: ^/admin, roles: ROLE_ADMIN }
44-
# - { path: ^/profile, roles: ROLE_USER }
47+
- { path: ^/logout, role: PUBLIC_ACCESS }
48+
- { path: ^/mfa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
4549

4650
when@test:
4751
security:

config/routes/scheb_2fa.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
2fa_login:
2-
path: /2fa
1+
mfa_login:
2+
path: /mfa
33
defaults:
44
_controller: "scheb_two_factor.form_controller::form"
55

6-
2fa_login_check:
7-
path: /2fa_check
6+
mfa_login_check:
7+
path: /mfa-check

0 commit comments

Comments
 (0)