delight-im/PHP-Auth

User already exists when registering using InnoDB

xRJx opened this issue · 3 comments

xRJx commented

I'm trying to get the login library to work with InnoDB by following this: #137

I changed users.email and users_confirmations.email to varchar(191) but I get a message saying "user already exists" when I attempt to register. Is there anything else I have to do that I missed? I'm still kinda new to using this library so I'm not all too familiar with how it works.

ocram commented

Are you using Auth#register or Auth#registerWithUniqueUsername?

Can you check in your database table users that there is indeed no user with the specified email address (and username)?

Apart from that, in your project directory, you could open vendor/delight-im/auth/src/UserManager.php, and in protected function createUserInternal, inside of catch (IntegrityConstraintViolationException $e) {}, log the full exception with all details and look at it.

xRJx commented

Are you using Auth#register or Auth#registerWithUniqueUsername?

Can you check in your database table users that there is indeed no user with the specified email address (and username)?

Apart from that, in your project directory, you could open vendor/delight-im/auth/src/UserManager.php, and in protected function createUserInternal, inside of catch (IntegrityConstraintViolationException $e) {}, log the full exception with all details and look at it.

Whoops, I see what I overlooked now. I was so used to using MyISAM without the foreign key constraints that I forgot I had made a foreign key that wasn't being filled upon user creation. I fixed that up with a default value. Sorry about that! A silly oversight on my part.

ocram commented

No problem, thanks!