Skip to content

Instantly share code, notes, and snippets.

@tarlepp
Forked from Kim-Vallee/routes.yaml
Created July 8, 2018 11:36
Show Gist options
  • Save tarlepp/3a84a093dbdd25cd38adaf74ec5c8f26 to your computer and use it in GitHub Desktop.
Save tarlepp/3a84a093dbdd25cd38adaf74ec5c8f26 to your computer and use it in GitHub Desktop.
#index:
# path: /
# controller: App\Controller\DefaultController::index
logout:
path: /logout
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
in_memory: { memory: ~ }
db_provider:
entity:
class: App\Entity\Adherent
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
anonymous: ~
http_basic: ~
provider: db_provider
form_login:
login_path: login
check_path: login
logout:
path: logout
target: homepage
# activate different ways to authenticate
# http_basic: true
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
# form_login: true
# https://symfony.com/doc/current/security/form_login_setup.html
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
encoders:
Symfony\Component\Security\Core\User\User:
algorithm: bcrypt
cost: 12
App\Entity\Adherent:
algorithm: bcrypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment