Zizaco / confide

Confide is a authentication solution for Laravel 4
1.19k stars 258 forks source link

Username field not created by confide:migration #509

Open iforwms opened 9 years ago

iforwms commented 9 years ago

I know this is specified in the docs as not being created (It will setup a table containing email, password, remember_token, confirmation_code and confirmed columns, which are the default fields needed for Confide use. Feel free to add more columns to the table later.)

But the sql query checks for username OR email equal to the customer input. As the username column does not exist by default, this throws an error.

andhikamaheva commented 9 years ago

Hi @iforwms-snippets I have same problem with you. You can delete or comment

 'username' => $emailOrUsername

line 103 in file vendor/zizaco/confide/src/Confide/EloquentRepository.php

furey-imagination commented 9 years ago

Same problem.

As EloquentRepository.php is part of the core package files, I've just added username back into the migration file (replacing ->unique() with ->nullable()).

gdevlugt commented 9 years ago

Hi,

Try using the --username option. This will add the username field to the migration.

php artisan confide:migration --username

Also don't forget to use that same --username option for creating the controller:

php artisan confide:controller --username

One immediate problem that occurs is that the username field isn't a required field, but it should be unique according to the database schema. Thus if on the registration form the username isn't entered and there already is a record stored with an empty username, a QueryException (Integrity constraint violation) is given.

Zizaco commented 9 years ago

Gonna fix this asap

tjimenez commented 9 years ago

Same here :(

Donny5300 commented 9 years ago

Status please. Currently setting up my login. Dont want to use the username or atleast have the possibility to choose.

Donny5300 commented 9 years ago

@Zizaco