Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Auth): Add correct validation for initial state when executing confirm sign in #2587

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

harsh62
Copy link
Member

@harsh62 harsh62 commented Nov 23, 2022

#2586

There are 2 changes being made:

  • Introduce sending of the confirmSignIn event outside of the state machine listener.
  • When in waitingForAnswer state, validate and return the nextStep based on the result

Description of changes:

Check points: (check or cross out if not relevant)

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@harsh62 harsh62 force-pushed the fix/2586-confirm-sign-in-endless-execution branch from 2712fa2 to 3aa0916 Compare November 23, 2022 16:34
@harsh62 harsh62 marked this pull request as ready for review November 23, 2022 16:34
@harsh62 harsh62 requested a review from a team as a code owner November 23, 2022 16:34
eventType: .verifyChallengeAnswer(confirmSignInData))
await authStateMachine.send(event)
guard let result = try UserPoolSignInHelper.checkNextStep(signInState) else {
continue
Copy link
Member

@atierian atierian Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think a labeled statement (maybe StateSequenceLoop) could help here to clearly see the loop's control flow points?

harsh62 and others added 2 commits November 23, 2022 12:14
…sts/AWSAuthSignInPluginTests.swift

Co-authored-by: Ian Saultz <[email protected]>
…sts/AWSAuthSignInPluginTests.swift

Co-authored-by: Ian Saultz <[email protected]>
@harsh62 harsh62 merged commit e313118 into main Nov 23, 2022
@harsh62 harsh62 deleted the fix/2586-confirm-sign-in-endless-execution branch November 23, 2022 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants