Comments (8)
Can you dig in a little bit and provide a bugfix?
#182 fixes the error (for me)
from nucleosuserbundle.
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.
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.
Can you try to investigate and provide a PR with a bugfix @fkrauthan ?
from nucleosuserbundle.
@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.
Ok I found a list of things that are wrong:
- It is recommended to use
AuthenticationUtils
to get the last error message and last username (with that it works) - You currently try to process error message in two places (not good practice)
- It seems like in general the form is complaining about Invalid CSRF token
- 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.
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.
Sorry for the delay. I'll publish a new version this weekend
from nucleosuserbundle.
Related Issues (20)
- Support for impersonating users HOT 1
- Is there a way to add features to the create command? HOT 1
- Cannot install this bundle due to outdated package... HOT 3
- Applying the documented password restrictions breaks when changing password with different new passwords HOT 1
- Reset Password via SymfonyCasts? HOT 2
- Remove `LocaleAwareInterface`
- Override default profile route
- Add symfony 6 support
- Migrate routing files to PHP
- Restore "Remember Me" functionality
- User Constructor not called on login. groups not being initialized HOT 2
- Adding Validation Groups for Override HOT 1
- Dependency Dashboard
- invalid password migrating from FOSUserBundle HOT 1
- Documentation update HOT 1
- Override templates twig
- PW reset email error, $user must not be accessed before initialization HOT 2
- UserListener not being called when changing password
- Serialization error for rememberme token after upgrading to 2.x HOT 2
- Login form uses `getMessage()` instead of `getMessageKey()` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nucleosuserbundle.