+1
-10
app/mastodon_api.rb
+1
-10
app/mastodon_api.rb
···
31
31
end
32
32
33
33
def oauth_login_with_password(client_id, client_secret, email, password, scopes)
34
-
url = URI("https://#{@host}/oauth/token")
35
-
36
34
params = {
37
35
client_id: client_id,
38
36
client_secret: client_secret,
···
42
40
password: password
43
41
}
44
42
45
-
response = Net::HTTP.post_form(url, params)
46
-
status = response.code.to_i
47
-
48
-
if status / 100 == 2
49
-
JSON.parse(response.body)
50
-
else
51
-
raise APIError.new(response)
52
-
end
43
+
post_json("https://#{@host}/oauth/token", params)
53
44
end
54
45
55
46
def account_info