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): remove duplicate continuation call for hosted UI #3112

Merged

Conversation

Jordan-Nelson
Copy link
Member

Issue #, if available: #3089

Description of changes:

  • remove unnecessary guard for session.start()

While there is no apple documentation stating this, it seems that the completion handler passed into ASWebAuthenticationSession will always be called upon start, which means that handling the case that start returns false is not needed. The removes the possibility of the continuation being resumed multiple times, which will cause the app to crash when in release mode.

This is consistent with Amplify-Swift as can be seen here.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Jordan-Nelson Jordan-Nelson requested a review from a team as a code owner May 26, 2023 19:44
@Jordan-Nelson Jordan-Nelson merged commit ff43611 into aws-amplify:main May 26, 2023
@Jordan-Nelson Jordan-Nelson deleted the fix/auth/hosted-ui-continuation branch May 26, 2023 19:56
dnys1 pushed a commit that referenced this pull request Jun 1, 2023
### Fixes
- fix(android): Bump Amplify Android to 2.8.3 ([#3023](#3023))
- fix(auth): User attribute serialization
- fix(auth): remove duplicate continuation call for hosted UI ([#3112](#3112))
- fix(authenticator): Only call `setState` if mounted ([#3076](#3076))
- fix(authenticator): alphabetize country codes
- fix(datastore): support nested predicates for observe and observeQuery ([#3029](#3029))
- fix(secure_storage): Fallback for CFStringRef decoding ([#3111](#3111))
- fix: suppress browser on sign out when preferPrivateSession is true ([#3099](#3099))

### Features
- feat(authenticator, m3): use SearchAnchor for country code
- feat(authenticator, m3): use `FilledButton` for primary buttons

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request Jun 1, 2023
### Fixes
- fix(android): Bump Amplify Android to 2.8.3 ([#3023](#3023))
- fix(auth): User attribute serialization
- fix(auth): remove duplicate continuation call for hosted UI ([#3112](#3112))
- fix(authenticator): Only call `setState` if mounted ([#3076](#3076))
- fix(authenticator): alphabetize country codes
- fix(datastore): support nested predicates for observe and observeQuery ([#3029](#3029))
- fix(secure_storage): Fallback for CFStringRef decoding ([#3111](#3111))
- fix: suppress browser on sign out when preferPrivateSession is true ([#3099](#3099))

### Features
- feat(authenticator, m3): use SearchAnchor for country code
- feat(authenticator, m3): use `FilledButton` for primary buttons

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
Stivenmore pushed a commit to JunoLuK/amplify-flutter that referenced this pull request Jun 9, 2023
dnys1 added a commit that referenced this pull request Jun 21, 2023
* chore(notifications): Update mocks (#2853)

* chore(notifications): Update mocks

* fix(storage): API doc errors

Update packages/storage/amplify_storage_s3_dart/lib/src/model/s3_remove_plugin_options.dart

Co-authored-by: NikaHsn <[email protected]>

* chore(aws_common): Prevent build errors in Dart 3 (#2866)

chore(aws_common): Add `dart` flag to prevent build errors in 3.0

* chore(core): Fix Dart 3 build error (#2869)

* ci(repo): Remove `next` from CI branch list

* ci(repo): Consider transitive dependencies in workflows

Includes transitive dependencies in the `paths` of packages' CI workflows so that changes which could affect this package are caught in CI.

* ci: Disable Dart 3 checks (#2870)

* ci: Disable Dart 3 checks

Trying to support Dart 3 right now is a game of whack-a-mole.. to be re-enabled when the repo is migrated fully.

* revert(core): Dart 3 workarounds

* chore(api): Override `toString` on `GraphQLResponse`

* chore(storage): Add debuggability to `S3Item`

* chore(auth): Override `toString` on `JsonWebToken`

* chore(github): Update BUG-REPORT template (#2871)

* chore(github): Update BUG-REPORT template (#1705)

Adds beta platforms to the BUG-REPORT template

commit-id:41bf7773

* chore(repo): Update bug report to include deployment option (#1928)

Adds the following info to the bug report template:
- Whether the CLI or another mechanism was used to deploy their backend
- Their sanitized amplifyconfig

These both seem to provide a lot of insight and they can be missed in the conversation, especially the first one. We cannot assume that people filing issues are using pristine Amplify-generated backends.

* chore(repo): Slim down bug report template (#2586)

The current bug report template is very long and may discourage people from submitting feedback. While many of these would be great to know, only some are needed to begin triaging correctly.

I've removed the ask for their Amplify config as well. I've noticed some people are not sure how to provide it and that more often than not, it's the `schema.graphql` we need rather.

* chore(repo): Update READMEs (#2864)

Removes developer preview references and updates any example code snippets.

* chore: update repository urls (#2872)

chore: update repository url

* ci(repo): Remove CircleCI tests (#2862)

Removes all but canaries from the CircleCI configuration

* chore: add CI check for workflows (#2873)

* chore(aft): generate `set-exit-if-changed` flag

* chore: add CI check for workflows

* chore: add `writeWorkflowFile` fn

* chore(amplify_flutter): Remove circular dependencies

`amplify_flutter` does not need to directly depend on plugins and can use mocking in unit tests instead.

* chore(repo): Use local path dependencies for unpublished packages

To prevent publishing errors

* chore(aft): Include `dev_dependencies` in topological sort

This will prevent any publishing errors ahead of time

* chore(analytics): mockable httpClient (#2875)

* chore(ios): bump amplify-swift to 1.29.2 (#2874)

- Fixing issue #2519

* chore(api): Decode optional ErrorType property (#2852)

* chore(api): Decode optional ErrorType property

* chore: added errorInfo property

* chore(notifications): add push userAgent headers to analytics calls (#2861)

* chore: add userAgent headers to anayltics calls

* chore: remove print and add update endpoint after settign user

* chore: updated mocks and added analyzer expection rule to ignore version.dart

* chore: pass testDispatcher to request permissions tes android native

* chore: update test name and useragent public

* chore: remove vesion dependency becuase user agent string does not need it

* chore: add comment on why setUser has no userAgent added

* chore: review comments

* chore(version): v1 Release (#2876)

* chore(version): Bump version

Stable v1 release! 🎉

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee

* chore(notifications): Fix pana issues

* Update DataStore spiel

* test(auth): Fix e2e test (#2880)

`additionalInfo` now returns and empty map instead of `null` by default

* chore(repo): Add migration guide to READMEs (#2887)

* fix(aft): Run `pub get` before `build_runner` in version-bump

If `aft version-bump` is run in a fresh repo/worktree, build_runner will fail since `pub get` has never been run. Running again also doesn't hurt.

* chore(version): Bump version

### Fixes
- fix(repo): Flutter 3.3 support
- fix(storage): API doc errors
- fix: convert AuthUserAttributeKey in updateUserAttributes
- fix: remove AndroidKeysetManager log, upgrade to google/tink 1.8.0

Updated-Components: amplify_flutter, amplify_flutter_android, amplify_core, amplify_datastore, amplify_analytics_pinpoint, amplify_api, amplify_api_android, amplify_api_ios, amplify_auth_cognito, amplify_auth_cognito_android, amplify_auth_cognito_ios, amplify_push_notifications, amplify_push_notifications_pinpoint, amplify_storage_s3, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee

* chore(version): Bump version

### Fixes
- fix(android): Bump Amplify Android to 2.8.3 ([#3023](#3023))
- fix(auth): User attribute serialization
- fix(auth): remove duplicate continuation call for hosted UI ([#3112](#3112))
- fix(authenticator): Only call `setState` if mounted ([#3076](#3076))
- fix(authenticator): alphabetize country codes
- fix(datastore): support nested predicates for observe and observeQuery ([#3029](#3029))
- fix(secure_storage): Fallback for CFStringRef decoding ([#3111](#3111))
- fix: suppress browser on sign out when preferPrivateSession is true ([#3099](#3099))

### Features
- feat(authenticator, m3): use SearchAnchor for country code
- feat(authenticator, m3): use `FilledButton` for primary buttons

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee

* chore(deps): Bump `built_value` dependency (#3104)

* chore(repo): add notifications (push) as an option in issue template (#3145)

* chore(smithy): Fix switch lint (#3151)

Fixes a lint introduced in latest Dart stable for switching on a `Type`

* fix(core): Disallowed JS tearoff (#3150)

Dart 3.1 disallows tearoffs of JS methods.

* fix(auth): Attribute key equality (#3136)

Two keys should be equal if the lower-case value of their keys are equal regardless of their class.

* chore(storage): fix flaky signer scope unit tests for Windows (#3152)

* fix(auth): `signOut` after user deletion (#3162)

If a user is deleted by an administrator while logged into a device, calling `signOut` can fail when tokens have also expired. The library gets stuck because credentials are not cleared but they are also invalid and cannot be refreshed.

* Update README.md (#3140)

* Update README.md

updated readme slightly

* Update README.md

Co-authored-by: Dillon Nys <[email protected]>

* Update README.md

Co-authored-by: Dillon Nys <[email protected]>

---------

Co-authored-by: Dillon Nys <[email protected]>

* fix(api): GraphQL subscription with custom domain formats URI correctly (#3148)

* fix(smithy-aws): fix S3ClientConfig copyWith implementation

* chore: remove test_api override (#3174)

* chore: fix typo in doc comment

* chore: log warning for duplicate fields

* chore(infra): update storage integ test stacks

* feat(storage): using path style URLs when bucket name contains dots

* ci(canaries): Ensure `pubspec.lock` (#3159)

* chore(deps): Update `code_builder`

* chore(smithy_codegen): Update union generation

Use `sealed` from `code_builder`

* chore(smithy_codegen): Update generated pubspec

* chore(smithy): Regenerate goldens

* chore(core): User agent enhancements (#3153)

Tracks the category and method from which an API call originated for the purpose of engagement analytics.

* feat(aft): Dependabot generation

Adds dependabot generation to the `aft generate workflows` command

* chore: Update dependabot config

* chore(smoke_test): Run build_runner (#3080)

chore(smoke_test): Regenerate

* chore(deps): bump org.robolectric:robolectric

Bumps [org.robolectric:robolectric](https://github.com/robolectric/robolectric) from 4.9 to 4.10.3.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.9...robolectric-4.10.3)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump org.robolectric:robolectric

Bumps [org.robolectric:robolectric](https://github.com/robolectric/robolectric) from 4.9 to 4.10.3.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.9...robolectric-4.10.3)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump org.robolectric:robolectric

Bumps [org.robolectric:robolectric](https://github.com/robolectric/robolectric) from 4.9 to 4.10.3.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.9...robolectric-4.10.3)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 in /packages/common/amplify_db_common/android (#3189)

chore(deps): bump com.android.tools.build:gradle

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 in /packages/auth/amplify_auth_cognito/android (#3200)

chore(deps): bump com.android.tools.build:gradle

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 in /packages/amplify_datastore/android (#3185)

chore(deps): bump com.android.tools.build:gradle

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 in /packages/amplify_native_legacy_wrapper/android (#3184)

chore(deps): bump com.android.tools.build:gradle

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 in /packages/secure_storage/amplify_secure_storage/android (#3219)

chore(deps): bump com.android.tools.build:gradle

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* infra: Fix storage bucket name (#3222)

ci: Fix storage bucket name

Bucket names must be globally unique. To ensure the infra stacks can be deployed to multiple accounts, use the bucket name as a prefix instead of the actual bucket name.

* chore(infra): Add ASF backend

Adds new E2E backend for testing ASF features.

* feat(auth): ASF

Adds advanced security features (ASF) support to the Auth library.

* chore: Update devcontainer configuration

* test(auth): ASF

Adds unit and e2e tests for ASF features in the Auth library. E2E tests require some Admin methods in the AWS SDK for Cognito, and these operations are exposed via the `amplify_integration_test` package.

* chore(smithy): Update dependency constraints

* chore(auth): Clean up

* chore(smithy_codegen): Fix deprecated usage (#3224)

* ci: Add default Android workflow

* ci: Run integ tests when the workflow changes

* chore(aws_common): Update `AWSService` (#3234)

Regenerates AWSService class and makes it possible to use services not automatically generated.

* chore(core): Adjust log-level of state machine errors (#3248)

Errors generated by the state machine are being logged at `error ` level regardless of whether they are handled by the developer. This can be confusing (as seen in #3226) since they print similar to how an unhandled exception would be printed.

By adjusting the log level, these messages are still available if desired and will not affect how errors are surfaced via throwing.

* ci: Fix Android build workflow

* chore(push_notifications): Add empty example

For testing build

* ci: Fix push notifications workflow

Should be Android Test not Android Build

* chore(aft): Update package selector test

* chore(push_notifications): Fix example

* chore(deps): bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 in /packages/analytics/amplify_analytics_pinpoint/android (#3215)

chore(deps): bump com.android.tools.build:gradle

Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dillon Nys <[email protected]>

* chore(version): Bump version

### Fixes
- fix(api): GraphQL subscription with custom domain formats URI correctly ([#3148](#3148))
- fix(auth): Attribute key equality ([#3136](#3136))
- fix(auth): `signOut` after user deletion ([#3162](#3162))
- fix(core): Disallowed JS tearoff ([#3150](#3150))
- fix(storage): API doc errors

### Features
- feat(auth): ASF
- feat(storage): using path style URLs when bucket name contains dots

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee

* chore(version): Bump version

### Fixes
- fix(api): GraphQL subscription with custom domain formats URI correctly ([#3148](#3148))
- fix(auth): Attribute key equality ([#3136](#3136))
- fix(auth): `signOut` after user deletion ([#3162](#3162))
- fix(core): Disallowed JS tearoff ([#3150](#3150))
- fix(storage): API doc errors

### Features
- feat(auth): ASF
- feat(storage): using path style URLs when bucket name contains dots

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Hui Zhao <[email protected]>
Co-authored-by: NikaHsn <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>
Co-authored-by: kc <[email protected]>
Co-authored-by: Hui Zhao <[email protected]>
Co-authored-by: Elijah Quartey <[email protected]>
Co-authored-by: ManojNB <[email protected]>
Co-authored-by: Abdallah Shaban <[email protected]>
Co-authored-by: Travis Sheppard <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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