Open ncb000gt opened 6 years ago
Even with the fix in GH-17 I am still running into an issue:
flutter: errrr: CognitoUserException: User Confirmation Necessary - #0 CognitoUser._authenticateUserInternal (package:amazon_cognito_identity_dart/src/cognito_user.dart:146:7)
<asynchronous suspension>
#1 CognitoUser._authenticateUserDefaultAuth (package:amazon_cognito_identity_dart/src/cognito_user.dart:628:12)
<asynchronous suspension>
#2 CognitoUser.authenticateUser (package:amazon_cognito_identity_dart/src/cognito_user.dart:437:20)
<asynchronous suspension>
#3 AuthService.login (file:///Users/ncampbell/Code/flutter_cognito_auth_test/lib/auth.dart:122:34)
<asynchronous suspension>
#4 _AuthGatewayState.submit (file:///Users/ncampbell/Code/flutter_cognito_auth_test/lib/main.dart:68:23)
<asynchronous suspension>
#5 _AuthGatewayState.build.<anonymous closure>.<anonymous closure> (file:///Users/ncampbell/Code/flutter_cognito_auth_test/lib/main.dart:148:13)
#6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14)
#7 _InkResponseSta<…>
It seems as though it isn't confirming the device, but I'm not really sure why that's not working. Any ideas?
I added && !_signInUserSession.isValid()
to line cognito_user.dart:145
which seems to be the right approach. But, I didn't want to push that up as I've only spent a small amount of time with the code.
I can add that to the PR if you agree.
Thanks for the find + feedback. Will look into it!
@jonsaw any thoughts regarding the && !_signInUserSession.isValid()
bit?
Sorry for the late reply. Is your setup close to the one found on Serverless Stack?
@jonsaw yea. it's very similar except that i'm not using a custom domain for the the app auth because i'm handling it internally through two means, a flutter mobile app (using this lib) and through the web using amplify.
I haven't spent much more time digging into this either on my end. I suppose I should put it on my roadmap. ;D If I find anything else about this I'll post here.
I have the same problem. I also added && !_signInUserSession.isValid()
to line cognito_user.dart:145
to temporary resolve this problem.
Thanks for putting this out there. I ran into an issue trying to authenticate using the library so I broke the code out into an example application and was able to isolate the issue to
lib/cognito_user.dart:144
.I noticed the issue in
0.0.17
and pulledmaster
to double check. The issue exists there as well.I have a fix in a branch I'm working on and will push a PR up for it once I'm comfortable that all the issues are resolved.