comparison src/services/kitsu.cc @ 349:7e97c566cce4

services/kitsu: remove unused parameters in functions
author Paper <paper@paper.us.eu.org>
date Tue, 25 Jun 2024 16:27:38 -0400
parents 5098387a3a46
children
comparison
equal deleted inserted replaced
348:6b0768158dcd 349:7e97c566cce4
84 /* the next two are not that important */ 84 /* the next two are not that important */
85 85
86 return true; 86 return true;
87 } 87 }
88 88
89 static bool RefreshAccessToken(std::string& access_token, const std::string& refresh_token) { 89 static bool RefreshAccessToken(void) {
90 const nlohmann::json request = { 90 const nlohmann::json request = {
91 {"grant_type", "refresh_token"}, 91 {"grant_type", "refresh_token"},
92 {"refresh_token", refresh_token} 92 {"refresh_token", session.config.auth.kitsu.refresh_token},
93 }; 93 };
94 94
95 if (!SendAuthRequest(request)) 95 if (!SendAuthRequest(request))
96 return false; 96 return false;
97 97
102 102
103 static std::optional<std::string> AccountAccessToken() { 103 static std::optional<std::string> AccountAccessToken() {
104 auto& auth = session.config.auth.kitsu; 104 auto& auth = session.config.auth.kitsu;
105 105
106 if (Time::GetSystemTime() >= session.config.auth.kitsu.access_token_expiration) 106 if (Time::GetSystemTime() >= session.config.auth.kitsu.access_token_expiration)
107 if (!RefreshAccessToken(auth.access_token, auth.refresh_token)) 107 if (!RefreshAccessToken())
108 return std::nullopt; 108 return std::nullopt;
109 109
110 return auth.access_token; 110 return auth.access_token;
111 } 111 }
112 112