Giter Club home page Giter Club logo

Comments (8)

core23 avatar core23 commented on June 17, 2024

Can you dig in a little bit and provide a bugfix?

#182 fixes the error (for me)

from nucleosuserbundle.

mrcmorales avatar mrcmorales commented on June 17, 2024

hi @core23

The problem is that if I try to do the login with wrong password the form hasn't erros but on the other hand If I put the correct password the login is working correctly.

My bundle config:

nucleos_user:
    db_driver: mongodb
    firewall_name: main
    user_class: 'App\IS\User\Document\User'
    from_email: '%env(MAIL_SENDER)%'

My security.yaml config

    encoders:
        Nucleos\UserBundle\Model\UserInterface: auto

    role_hierarchy:
        ROLE_ADMIN:       [ROLE_STORE, ROLE_USER]
        ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        nucleos_userbundle:
            id: nucleos_user.user_provider.username_email

    firewalls:
        # disables authentication for assets and the profiler, adapt it according to your needs
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            pattern: ^/
            form_login:
                provider: nucleos_userbundle
                default_target_path: /
                check_path: /login_check
                login_path: /login
#                csrf_token_generator: security.csrf.token_manager
#                failure_handler: App\IS\User\AuthenticationHandler\AuthenticationHandler
                #always_use_default_target_path: true
            logout:
                target: /
            anonymous:    true

    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/change-password, role: IS_AUTHENTICATED_REMEMBERED }
        - { path: ^/user, role: ROLE_USER }
        - { path: ^/checkout, role: ROLE_USER }
        - { path: ^/store, role: ROLE_STORE }
        - { path: ^/admin, role: ROLE_ADMIN }

Thank you

from nucleosuserbundle.

fkrauthan avatar fkrauthan commented on June 17, 2024

I have the same error. I just upgraded from version 1.5.0 to 1.6.1 but I don't get any errors. When using the debug toolbar the form is saying there are no errors (even though I believe your code change suppose to populate it with a login error).

from nucleosuserbundle.

core23 avatar core23 commented on June 17, 2024

Can you try to investigate and provide a PR with a bugfix @fkrauthan ?

from nucleosuserbundle.

fkrauthan avatar fkrauthan commented on June 17, 2024

@core23 sure I can look into it. But is there a reason why you process the Security::AUTHENTICATION_ERROR in LoginFormType as well as LoginAction?

from nucleosuserbundle.

fkrauthan avatar fkrauthan commented on June 17, 2024

Ok I found a list of things that are wrong:

  1. It is recommended to use AuthenticationUtils to get the last error message and last username (with that it works)
  2. You currently try to process error message in two places (not good practice)
  3. It seems like in general the form is complaining about Invalid CSRF token
  4. The setData call in the form seem to be wrong as well as you set the username field instead of the _username field

from nucleosuserbundle.

fkrauthan avatar fkrauthan commented on June 17, 2024

Do you have already an idea when you might publish a new version? This (and the one ticket on ProfileBundle) are currently blocking my Symfony 4.4. upgrade of my Browsergame

from nucleosuserbundle.

core23 avatar core23 commented on June 17, 2024

Sorry for the delay. I'll publish a new version this weekend

from nucleosuserbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.