delight-im / PHP-Auth

Authentication for PHP. Simple, lightweight and secure.
MIT License
1.1k stars 235 forks source link

logging in throws database error => throw new DatabaseError(); #91

Closed ftwebdesign closed 6 years ago

ftwebdesign commented 6 years ago

I have had a lot of trouble with the login function, and finally tried it on test.php, and it fails their as well. I really like the program and hope to be able to use it, but this is a showstopper. http://drops.campfirepixels.info/qo1X.

I cloned the source, ran npm install, composer install and gulp.

ocram commented 6 years ago

Thanks for your appreciation and for the detailed information on this problem!

I’m sure there will be a simple solution, since this library should be working fine if the setup is correct. That means we need to know what your setup is exactly:

Thanks!

(By the way, running npm or gulp isn’t necessary, since they are not used in this project.)

ftwebdesign commented 6 years ago

I have determined it to be the database itself, but I don't know why. I created a new database and it works with a limited program. I replaced it with what we are using and it does not work.

We are using local by flywheel

ocram commented 6 years ago

Thanks, that looks all good.

Could you go into the vendor/delight-im/auth/src/UserManager.php file in your project directory, which has been put up there by Composer, and temporarily change line 266 of that file from

throw new DatabaseError();

to

throw new DatabaseError($e);

and then run the code in question again? You should be able to see a more expressive error message then, which hopefully helps tracking down the exact problem.

ftwebdesign commented 6 years ago

This was just testing data so it is not a big deal to reproduce. That is nice to know about modifying the error to be more verbose. I am the instructor and we are doing this as a class project. The problem was found by adding the $e to Auth on line 164. We can close this ticket, as it was not caused by the software, but by passing the database around and getting it corrupted.

ocram commented 6 years ago

Glad to hear that, thank you!