jelly-auth
jelly-auth copied to clipboard
Update Auth_Jelly::_get_object() to use "unique_key"
This would allow you to login using any parameter supported by the unique key method. For example an email address. The ORM Auth module currently supports this.
Update line 264 in classes/auth/jelly.php to use Jelly_Builder::load()
which uses the :unique_key
parameter internally.
// From
$current = Jelly::select('user')->where('user', '=', $user)->limit(1)->execute();
// To
$current = Jelly::select('user')->load($user);
Cheers,
Aron
Hi Aron,
There was a bug in Jelly that prevented me to use this. Can you confirm if this is fixed on the latest commit?
Thanks.
Hey,
The bug only affects Jelly_Builder::load()
when no $key
is passed in, it returns an unloaded model. Even so perhaps a better way to write this would be;
$current = Jelly::select('user')->where(':unique_key', '=', $user)->limit(1)->execute();
Then you don't get an empty model if the $user
parameter is falsy.
Cheers,
Aron