Laravel 5.1 Authentication without password


Problem:

I'm developing an app in Laravel 5.1. I need to be able to login users only with e-mail (not using password). I have a password field in my login form because I need it for other reasons, but the only thing that I need to check is that the user email exists in my users table. I rewrited the AuthController, and I'm trying to use the attempt() method, but when i try to login with a valid e-mail, it gives me the following error:

ErrorException in EloquentUserProvider.php line 112: Undefined index: password

How can I tell to EloquentUserProvider that I'm not using password to login, only username (e-mail)?

Thank you!!


Solution:

you can find the email with queries and have the id of user and then

Auth::loginUsingId(user_id);

it will authenticate the user_id .

Recent Tips

  1. django-bootstrap-v5 DecimalField Throwing Errors in ModelForm Class
  2. update and delete in realm xamarin
  3. Grabbing text between Processing Instructions in XSLT
  4. Foreign key refering to multiple tables
  5. Run a visual studio 2010 Windows7 project on a Windows XP machine
  6. How to apply groupname to HTML radio buttons in asp.net?
  7. What is the most stable modal dialog implementation across browsers to use from javascript for a web app?
  8. Move, Remove, and Replace information from Google Sheets with new entries using Google Script
  9. How can I get rid of jerkiness in WinForms scrolling animation?
  10. Update MySQL table column from another table entities
  11. Shoot fireball once in unity C#
  12. Adding a table of contents to a Microsoft Word Document using vbs
  13. Change locale in android app (onto Hindi)
  14. How do I stop selenium automation if 20% or 1st 20 test cases test methods are failed?
  15. Sharepoint with silverlight app
  16. What's the best way to write robots.txt for github pages using multiple repos?
  17. Biopython: Cant use .count() for biopython
  18. How can I find out the token balance of an address?
  19. ref value is undefined in vue (modal, textarea, $refs)
  20. Azure - HDInsight Hbase Data Insertion Failed
  21. SignalR overwriting OnConnected(), OnDisconnected()
  22. DatePickerDialog displays with two borders
  23. "type 'double' is not a subtype of type 'int' in type cast" error in flutter. What should i do?
  24. hiding the autocomplete list when user click outside the textbox is not working as expected
  25. JSF IceFaces basic problem with redisplaying input value
  26. How to validate material ui TextField in reactjs?
  27. Go and MongoDB connection won't work with panic log "no reachable server"
  28. WordPress Posts Pagination Not Working
  29. F# sprintf won't print in interactive console
  30. Spring Integration get FTP files recursively with outbound-gateway