From 602fb14ce769df899f7e2e894fa6d4398ca8bee4 Mon Sep 17 00:00:00 2001 From: Noyes Date: Thu, 23 Sep 2021 14:24:54 -0700 Subject: [PATCH] fix(amplify_auth_cognito): fixes getCurrentUser success --- .../com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/amplify_auth_cognito/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt b/packages/amplify_auth_cognito/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt index a46c38b8d6..22d9b0d65f 100644 --- a/packages/amplify_auth_cognito/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt +++ b/packages/amplify_auth_cognito/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt @@ -399,7 +399,8 @@ public class AuthCognito : FlutterPlugin, ActivityAware, MethodCallHandler, Plug AuthSessionResult.Type.SUCCESS -> { val awsMobileClient = AWSMobileClient.getInstance() val username = awsMobileClient.username - prepareUserResult(flutterResult, AuthUser(cognitoAuthSession.userSub.toString(), username)); + val userid = awsMobileClient.userSub + prepareUserResult(flutterResult, AuthUser(userid, username)); } // If the user sub accessor failed, check the signIn state AuthSessionResult.Type.FAILURE -> {