Coder Social home page Coder Social logo

Comments (4)

harsh62 avatar harsh62 commented on June 12, 2024

@rapgodnpm I see the code where you are initiating updateUserAttributes. Could you please also share the code snippet where the confirmation happens?
In the example that you have shared, I don't see confirmation of the attribute being done.

This behaviour usually happens when the attribute is left in an unconfirmed state.

from amplify-swift.

rapgodnpm avatar rapgodnpm commented on June 12, 2024

@rapgodnpm I see the code where you are initiating updateUserAttributes. Could you please also share the code snippet where the confirmation happens? In the example that you have shared, I don't see confirmation of the attribute being done.

This behaviour usually happens when the attribute is left in an unconfirmed state.

Sure, sorry, forgout about it:

onConfirmButtonPress: { code in
          withAnimation {
            isConfirmationLoading = true
          }
          
          defer {
            withAnimation {
              isConfirmationLoading = false
            }
          }

          Task {
            do {
              try await authApi.confirmEditAuthAttributes(
                for: .email,
                confirmationCode: code
              )
            } catch {
              withAnimation {
                errorMessage = "invalid-code".localized
                isError = true
              }

              print(error)
            }
            
            Task {@MainActor in
              value = temporaryValue
            }
            close()
          }
        }

And the autApi.confirmEditAuthAttributes:

func confirmEditAuthAttributes(for userAttribute: AuthUserAttributeKey, confirmationCode: String) async throws -> Void {
    try await Amplify.Auth.confirm(userAttribute: userAttribute, confirmationCode: confirmationCode)
  }

When I use it from the app or the simulator I receive the code then I confirm the attribute. Also in the cognito console ui I can see the new email, I can see that it's verified as well yet I can only sign in using the sub id.

from amplify-swift.

harsh62 avatar harsh62 commented on June 12, 2024

Thanks for providing this information. Could you also provide the following 3 things:

  1. Verbose logs when you see the user not found error.
  2. Verbose logs when change the email.
  3. Verbose logs when successfully sign in using sub..

You can enable verbose logging to the console by doing this before calling Amplify.configure:

Amplify.Logging.logLevel = .verbose

from amplify-swift.

rapgodnpm avatar rapgodnpm commented on June 12, 2024

Interesting, while trying to give you these logs it worked... to be honest I was on an older version and did update before submitting the ticket but didn't think to re-test it to see if it reproduces. To me, it seemed that it was more related to cognito than the packages but guess I was wrong.

Sorry for wasting your time and thank you for your help. If others encounter this please update to the latest version

from amplify-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.