Implemented login functionality.