Skip to content

Commit 394bc29

Browse files
committed
pass body directly
1 parent 2c0819c commit 394bc29

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

packages/gotrue/lib/src/gotrue_client.dart

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -390,20 +390,18 @@ class GoTrueClient {
390390
String? nonce,
391391
String? captchaToken,
392392
}) async {
393-
final body = {
394-
'provider': provider.snakeCase,
395-
'id_token': idToken,
396-
'nonce': nonce,
397-
'gotrue_meta_security': {'captcha_token': captchaToken},
398-
'access_token': accessToken,
399-
};
400-
401393
final response = await _fetch.request(
402394
'$_url/token',
403395
RequestMethodType.post,
404396
options: GotrueRequestOptions(
405397
headers: _headers,
406-
body: body,
398+
body: {
399+
'provider': provider.snakeCase,
400+
'id_token': idToken,
401+
'nonce': nonce,
402+
'gotrue_meta_security': {'captcha_token': captchaToken},
403+
'access_token': accessToken,
404+
},
407405
query: {'grant_type': 'id_token'},
408406
),
409407
);
@@ -923,22 +921,20 @@ class GoTrueClient {
923921
String? nonce,
924922
String? captchaToken,
925923
}) async {
926-
final body = {
927-
'provider': provider.snakeCase,
928-
'id_token': idToken,
929-
'nonce': nonce,
930-
'gotrue_meta_security': {'captcha_token': captchaToken},
931-
'access_token': accessToken,
932-
'link_identity': true,
933-
};
934-
935924
final response = await _fetch.request(
936925
'$_url/token',
937926
RequestMethodType.post,
938927
options: GotrueRequestOptions(
939928
headers: _headers,
940929
jwt: _currentSession?.accessToken,
941-
body: body,
930+
body: {
931+
'provider': provider.snakeCase,
932+
'id_token': idToken,
933+
'nonce': nonce,
934+
'gotrue_meta_security': {'captcha_token': captchaToken},
935+
'access_token': accessToken,
936+
'link_identity': true,
937+
},
942938
query: {'grant_type': 'id_token'},
943939
),
944940
);

0 commit comments

Comments
 (0)