Fix write access_token to file mistake

This commit is contained in:
Ansem 2017-04-07 22:06:06 +00:00
pare ebfe65a295
commit cb6e304043

Veure arxiu

@ -191,12 +191,7 @@ class Mastodon:
are wrong, scopes are not valid or granted scopes differ from requested. are wrong, scopes are not valid or granted scopes differ from requested.
Returns: Returns:
{ str @access_token
'scope': 'read',
'created_at': 1491599341,
'access_token': 'd8daf46d...',
'token_type': 'bearer'
}
""" """
if username is not None and password is not None: if username is not None and password is not None:
params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token']) params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token'])
@ -231,7 +226,7 @@ class Mastodon:
if to_file != None: if to_file != None:
with open(to_file, 'w') as token_file: with open(to_file, 'w') as token_file:
token_file.write(response + '\n') token_file.write(response['access_token'] + '\n')
return response['access_token'] return response['access_token']