kopia lustrzana https://github.com/halcy/Mastodon.py
Merge pull request #355 from lasseedfast/patch-1
Clarify the use of 'code' in log_in()pull/389/head
commit
1526c116ce
|
@ -27,6 +27,15 @@ Feature complete for public API as of Mastodon version 3.5.5 and easy to get sta
|
|||
to_file = 'pytooter_usercred.secret'
|
||||
)
|
||||
|
||||
# If you are logging in for the first time you need to give permissions to the app
|
||||
# via OAuth, at the URL given by auth_request_url() and then pass code instead of
|
||||
# username and password.
|
||||
mastodon.log_in(
|
||||
to_file = 'pytooter_usercred.secret',
|
||||
code='code_from_oauth,
|
||||
scopes=['read', 'write'],
|
||||
)
|
||||
|
||||
# Note that this won't work when using 2FA - you'll have to use OAuth, in that case.
|
||||
# To post, create an actual API instance:
|
||||
mastodon = Mastodon(access_token = 'pytooter_usercred.secret')
|
||||
|
|
|
@ -315,7 +315,7 @@ class Mastodon(Internals):
|
|||
For OAuth 2, obtain a code via having your user go to the URL returned by
|
||||
:ref:`auth_request_url() <auth_request_url()>` and pass it as the code parameter. In this case,
|
||||
make sure to also pass the same redirect_uri parameter as you used when
|
||||
generating the auth request URL.
|
||||
generating the auth request URL. If passing `code`you should not pass `username` or `password`.
|
||||
|
||||
Returns the access token as a string.
|
||||
"""
|
||||
|
|
Ładowanie…
Reference in New Issue