def authenticate(self, username=None, password=None):
        """
        Returns a valid `MojUser` if the authentication is successful
        or None if the credentials were wrong.
        """
        data = api_client.authenticate(username, password)
        if not data:
            return

        return User(
            data.get('pk'), data.get('token'), data.get('user_data')
        )
Returns a valid `MojUser` if the authentication is successful
        or None if the credentials were wrong.