Working login method.