Implemented a login mechanism.