security:
    password_hashers:
        App\Entity\Learner:
            algorithm: bcrypt
        App\Entity\Admin:
            algorithm: bcrypt
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        users_in_memory: { memory: null }
        
        learner:
            entity:
                class: App\Entity\Learner
                property: email
        
        admin: 
            entity:
                class: App\Entity\Admin
                property: email

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        admin:
            pattern: ^/admin
            #anonymous: true

            provider: admin
            form_login: 
                login_path: admin_account_login
                check_path: admin_account_login
                default_target_path: admin_dashboard
            logout:
                path: admin_account_logout
                target: admin_account_login

        main:
            #anonymous: true
            provider: learner
            form_login:
                login_path: account_login
                check_path: account_login
            logout:
                path: account_logout
                target: account_login

            # activate different ways to authenticate
            # https://symfony.com/doc/current/security.html#firewalls-authentication

            # https://symfony.com/doc/current/security/impersonating_user.html
            #switch_user: true

    # 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/login, roles: PUBLIC_ACCESS }
        - { path: ^/admin, roles: ROLE_ADMIN }
        - { path: ^/profile, roles: ROLE_USER, requires_channel: https }
