CodeIgniter Forums
Help searching email in Shield - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Help searching email in Shield (/showthread.php?tid=89928)

Pages: 1 2


Help searching email in Shield - frocco - 02-09-2024

Hello,

I am able to find records from the users table in Shield by username, I also what to filter by email.
I cannot get this to work. I get email field not found, but I can display email using users.email.

What is the correct syntax to get records by email?

Thanks


RE: Help searching email in Shield - InsiteFX - 02-09-2024

findByCredentials(array $credentials)

I believe that this returns the email, not tested


RE: Help searching email in Shield - kenjis - 02-09-2024

See https://shield.codeigniter.com/getting_started/concepts/#user-identities

Email is stored in the `auth_identities` table.
https://shield.codeigniter.com/customization/table_names/


RE: Help searching email in Shield - frocco - 02-10-2024

Thanks Everyone

(02-09-2024, 10:27 AM)InsiteFX Wrote: findByCredentials(array $credentials)

I believe that this returns the email, not tested

Thanks, I will test this and see.


RE: Help searching email in Shield - frocco - 02-10-2024

See https://shield.codeigniter.com/getting_s...identities

I am not finding getting_s...identities on that page


RE: Help searching email in Shield - InsiteFX - 02-11-2024

UserIdentityModel.php

SEE: Method createEmailIdentity


PHP Code:
'secret'  => $credentials['email'], 



RE: Help searching email in Shield - frocco - 02-11-2024

(02-11-2024, 12:40 AM)InsiteFX Wrote: UserIdentityModel.php

SEE: Method createEmailIdentity


PHP Code:
'secret'  => $credentials['email'], 

Is this the site you are talking abount?
I cannot find anything you are suggenting.

https://shield.codeigniter.com/


RE: Help searching email in Shield - kenjis - 02-11-2024

See https://github.com/codeigniter4/shield/blob/524cebace4f21383e8bebafef825156651ed5cf4/src/Models/UserIdentityModel.php#L85-L90


RE: Help searching email in Shield - kenjis - 02-11-2024

(02-10-2024, 09:03 AM)frocco Wrote: See https://shield.codeigniter.com/getting_s...identities

I am not finding getting_s...identities on that page

Click this link: https://shield.codeigniter.com/getting_started/concepts/#user-identities


RE: Help searching email in Shield - frocco - 02-12-2024

(02-11-2024, 05:30 PM)kenjis Wrote:
(02-10-2024, 09:03 AM)frocco Wrote: See https://shield.codeigniter.com/getting_s...identities

I am not finding getting_s...identities on that page

Click this link: https://shield.codeigniter.com/getting_started/concepts/#user-identities

Thank you
I found this in the UserIdentityModel
getIdentityBySecret