Completed local login functionality