mardi 9 février 2016

Query regarding using Sentinel with Laravel and the $fillable array

I'm using Cartalyst Sentinel for the user authentication within Laravel. I've created my form to add a new user. For some strange reason the password does not come through Sentinel::register() unless I put the password field into the $fillable array in the User class model. This is a potential security issue. How can I get around this? There must be something I am missing when creating a new user with Sentinel (and the Sentinel documents are very light on useful info).

Just a quick rundown of what I'm doing code wise. I have my array filled with the fields that are required to create a user. This array is passed into Sentinel::register(). It all seems to go through fine, but when I go to look in the database, the password field is blank.

$newUser = array(
    '_token' => Input::get('_token'),
    'email' => Input::get('email'),
    'password' => Input::get('password'),
    'first_name' => Input::get('first_name'),
    'middle_name' => Input::get('middle_name'),
    'last_name' => Input::get('last_name'));

$user = Sentinel::register($newUser);

Just a side note: unfortunately I cannot switch the authentication system. I need to use Sentinel.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire