kopia lustrzana https://gitlab.com/mysocialportal/relatica
Fix, add user agent to OAuth flow network calls.
rodzic
f623d4bf31
commit
039038dca7
|
@ -111,6 +111,7 @@ class OAuthCredentials implements ICredentials {
|
|||
final idEndpoint = Uri.parse('https://$serverName/api/v1/apps');
|
||||
|
||||
final request = NetworkRequest(idEndpoint,
|
||||
headers: ref.read(userAgentHeaderProvider),
|
||||
body: {
|
||||
'client_name': 'Relatica',
|
||||
'redirect_uris': redirectUrl,
|
||||
|
@ -180,13 +181,15 @@ class OAuthCredentials implements ICredentials {
|
|||
);
|
||||
}
|
||||
final url2 = Uri.parse('https://$serverName/oauth/token');
|
||||
final request = NetworkRequest(url2, body: {
|
||||
'client_id': clientId,
|
||||
'client_secret': clientSecret,
|
||||
'redirect_uri': redirectUrl,
|
||||
'grant_type': 'authorization_code',
|
||||
'code': code,
|
||||
});
|
||||
final request = NetworkRequest(url2,
|
||||
headers: ref.read(userAgentHeaderProvider),
|
||||
body: {
|
||||
'client_id': clientId,
|
||||
'client_secret': clientSecret,
|
||||
'redirect_uri': redirectUrl,
|
||||
'grant_type': 'authorization_code',
|
||||
'code': code,
|
||||
});
|
||||
final response = await ref.read(httpPostProvider(request).future);
|
||||
response.match(onSuccess: (body) {
|
||||
ref
|
||||
|
|
Ładowanie…
Reference in New Issue