Skip to content

Commit

Permalink
feat(gotrue): add accessToken to signInWithIdToken method (#520)
Browse files Browse the repository at this point in the history
* feat(gotrue): add accessToken parameter to signInWithIdToken method

* revert changes that accidently got mixed

* add more docs on signInWithIdToken method

* Update packages/gotrue/lib/src/gotrue_client.dart

Co-authored-by: Vinzent <vinzent03@proton.me>

---------

Co-authored-by: Vinzent <vinzent03@proton.me>
  • Loading branch information
dshukertjr and Vinzent03 authored Jun 23, 2023
1 parent 0120586 commit 4dcd596
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,21 @@ class GoTrueClient {
/// The [idToken] is verified for validity and a new session is established.
/// This method of signing in only supports [Provider.google] or [Provider.apple].
///
/// If the ID token contains an `at_hash` claim, then [accessToken] must be
/// provided to compare its hash with the value in the ID token.
///
/// If the ID token contains a `nonce` claim, then [nonce] must be
/// provided to compare its hash with the value in the ID token.
///
/// [captchaToken] is the verification token received when the user
/// completes the captcha on the app.
///
/// This method is experimental.
@experimental
Future<AuthResponse> signInWithIdToken({
required Provider provider,
required String idToken,
String? accessToken,
String? nonce,
String? captchaToken,
}) async {
Expand All @@ -327,6 +337,7 @@ class GoTrueClient {
'id_token': idToken,
'nonce': nonce,
'gotrue_meta_security': {'captcha_token': captchaToken},
'access_token': accessToken,
},
query: {'grant_type': 'id_token'},
),
Expand Down

0 comments on commit 4dcd596

Please sign in to comment.