This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Login error

Discuss Symfony 2 bundles here

Login error

by ViC2 » Fri Mar 06, 2015 4:56 pm

Hi,
this is my security.yml file:
Code: Select all
security:
    firewalls:
        frontend:
            pattern: ^/*
            anonymous: ~
            provider: users
            form_login:
                login_path: /login
                check_path: /login_check
                default_target_path: /
            logout:
                path:    /logout
                target: /
    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/*,     roles: ROLE_USER }

    providers:
        users:
            entity: { class: Intranet\OrganizationBundle\Entity\Worker, property: username }

    encoders:
        Intranet\OrganizationBundle\Entity\Worker: plaintext

    role_hierarchy:
        ROLE_ADMIN: [ROLE_SUPERVISOR, ROLE_USER]
        ROLE_SUPERVISOR: [ROLE_USER]


This is my routing.yml file:
Code: Select all
front_homepage:
    path:     /
    defaults: { _controller: FrontBundle:Default:index }

login:
    pattern: /login
    defaults: { _controller: FrontBundle:Default:login }

login_check:
    pattern: /login_check

logout:
    pattern: /logout


But when I login I get redirected to this weird url: http://localhost/intranet/web/app_dev.php/_wdt/afbb8c, then when I manually write this address: http://localhost/intranet/web/app_dev.php/ in the address bar, the site works ok and the user was authenticated. What I am doing wrong?
Thanks in advance,
Do you realize that the sun doesn't go down? It's just an illusion caused by the world spinning round...
User avatar
ViC2
Junior Member
 
Posts: 7
Joined: Mon Jul 14, 2014 7:31 pm
Location: Matanzas Bay