function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
The new LearnerThe new Learner 

Community attempts

HI Experts,

I have requirment where i need to login attempts of a community user ,its more than 5 login attempts , i need to populate an error message. can anyone help me please.
AnudeepAnudeep (Salesforce Developers) 
I recommend looking at the Status field in LoginHistory object to retrieve this information

Status filed gives Success or the Error Message (like Invalid password, Failed: API security token)

From APEX code you can run the following SOQL.
Select l.UserId, l.Status, l.Id From LoginHistory l

This will give you the information you want.

If you find this information helpful, please mark this answer as Best. It may help others in the community

Thanks, 
Anudeep