Adding logic to the Login Controller