Completed login functionality