Question

Well, since I upgraded my Symfony to 2.2 version something happened with FosUserBundle. Let me introduce you first what do I currently have. I'm using AdminGeneratorBundle connected with FosUserBundle (2.0v already). The problem is, that when I am logged in and I see the list of objects of my BkdSthBundle everything is alright. The problem starts when I'm trying to make a new object or delete the existing one. Then it automatically loggs me out and I am unable to log in till I clear the cache. Totally weird. What is funny, I do can edit the object, save it and other things - BUT cannot make a new one, or delete it. I spent countless hours doing it, checking it, but nothing changed.

I have overrided the SecurityController just to catch some errors, but everytime I gave empty string ( no error ).

Any kind of help would be much appreciated.

Below there are some configs from my project.

config.yml

 secret:          "%secret%"
router:
    resource: "%kernel.root_dir%/config/routing.yml"
    strict_requirements: "%kernel.debug%"
form:            true
csrf_protection: true
validation:      { enable_annotations: true }
templating:      { engines: ['twig'] } #assets_version: SomeVersionScheme
default_locale:  "%locale%"
trust_proxy_headers: false # Deprecated in 2.0; will be removed in 2.3 (used trusted_proxies instead)
trusted_proxies: ~
session:  ~
translator:  { fallback: 'pl_PL' }

security.yml

jms_security_extra:
secure_all_services: false
expressions: true

security:
 encoders:
    FOS\UserBundle\Model\UserInterface: sha512

 role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: ROLE_ADMIN

 providers:
    fos_userbundle:
        id: fos_user.user_provider.username

 firewalls:
    main:
        pattern: ^/
        form_login:
            provider: fos_userbundle
            csrf_provider: form.csrf_provider
            default_target_path: /admin
        logout:       true
        anonymous:    true

 access_control:
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/, role: ROLE_ADMIN }

Thank you in advance.

Was it helpful?

Solution

Problem solved.

It was a problem with constanting updates via composer(I had "*" in admingenerator and symfony versions), which influenced on admingenerator working. Moreover, I've overrided every templates there, so that, somehow It had logged me off.

Anyway, it's ok now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top