简体   繁体   中英

Symfony2 Login - Bad Credentials

I've been trying to get a database login system working with Symfony2. I've read through the docs but I'm totally stumped now as to what to do...

Every time I try to log in I just get 'Bad Credentials'.

The 'User' class implementing UserInterface is here:

http://pastebin.com/9uzbwM9v

The 'UserRepository' class is here:

http://pastebin.com/Gn0AbZb4

The 'security.yml' file is here:

http://pastebin.com/50FUNnbq

The database scheme is like this:

http://pastebin.com/5nj0rXhs

I just have no idea where to go from here... :L I've been looking around and I'm just not getting some of the other things in tutorials, maybe it's just the time of day! It's been a long week...

Any help would be greatly appreciated.

At a glance, you have a small typo in your loadUserByUsername method:

->where('u.account_name = :usefdgdfgfrname OR u.account_email = :email')

Should be:

->where('u.account_name = :username OR u.account_email = :email')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM