Login functionality done with user validation