diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9482f8c..58c6d55 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,7 @@ v2.0.0 (IN PROGRESS) * Fixed a potential issue with modification to locals (Thanks Konano) * Added support for 4.3.0 `accounts` endpoint (Thanks AlexKalopsia) * Fix version parsing for GoToSocial (Thanks gmemstr) +* Updated docs to reflect the fact that startign with 4.4.0, the password grant type is no longer supported. v1.8.1 ------ diff --git a/mastodon/authentication.py b/mastodon/authentication.py index 499cc0b..2074206 100644 --- a/mastodon/authentication.py +++ b/mastodon/authentication.py @@ -320,6 +320,10 @@ class Mastodon(Internals): Returns the access token as a string. """ + # Is the version > 4.4.0? Throw on trying to log in with password with a more informative message than the API error + if self.mastodon_major >= 4 and self.mastodon_minor >= 4: + raise MastodonIllegalArgumentError('Password flow is no longer supported in Mastodon 4.4.0 and later.') + if username is not None and password is not None: params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token']) params['grant_type'] = 'password'