diff options
author | Lorenz Diener <[email protected]> | 2016-11-24 12:07:41 +0100 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2016-11-24 12:07:41 +0100 |
commit | ead7b7fc5ed5fe4cd4eec4475de5e4addfbcef76 (patch) | |
tree | ac4739d2c89874d800e248d5c13f540840831079 | |
parent | 68899a0cc4837f0202e2542f5308e61d079e7a2e (diff) | |
download | mastodon.py-ead7b7fc5ed5fe4cd4eec4475de5e4addfbcef76.tar.gz |
Fixed login scope check
-rw-r--r-- | mastodon/Mastodon.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index efbe89d..08821b8 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -101,8 +101,8 @@ class Mastodon: | |||
101 | except: | 101 | except: |
102 | raise ValueError('Invalid user name, password or scopes.') | 102 | raise ValueError('Invalid user name, password or scopes.') |
103 | 103 | ||
104 | requested_scopes = " ".join(scopes) | 104 | requested_scopes = " ".join(sorted(scopes)) |
105 | received_scopes = " ".join(sorted(response["scopes"].split(" "))) | 105 | received_scopes = " ".join(sorted(response["scope"].split(" "))) |
106 | 106 | ||
107 | if requested_scopes != received_scopes: | 107 | if requested_scopes != received_scopes: |
108 | raise ValueError('Granted scopes "' + received_scopes + '" differ from requested scopes "' + requested_scopes + '".') | 108 | raise ValueError('Granted scopes "' + received_scopes + '" differ from requested scopes "' + requested_scopes + '".') |