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

chore: Upgrading to Amplify 2.16+ #38

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.6 (2023-09-14)

### Misc. Updates
- Updating code to support Amplify 2.16+. However, **TOTP** workflows are **not** yet supported.

## 1.0.5 (2023-08-31)

### Bug Fixes
Expand Down
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/aws-amplify/amplify-swift",
"state" : {
"revision" : "3a795314e98434d063f68bf5dcf788124ac18406",
"version" : "2.15.1"
"revision" : "76ba8f1ead1cac4d53f313fb8d214c7bc5000551",
"version" : "2.17.1"
}
},
{
Expand All @@ -23,8 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/aws-amplify/aws-appsync-realtime-client-ios.git",
"state" : {
"revision" : "b036e83716789c13a3480eeb292b70caa54114f2",
"version" : "3.1.0"
"revision" : "c7ec93dcbbcd8abc90c74203937f207a7fcaa611",
"version" : "3.1.1"
}
},
{
Expand Down Expand Up @@ -86,8 +86,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "32e8d724467f8fe623624570367e3d50c5638e46",
"version" : "1.5.2"
"revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed",
"version" : "1.5.3"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
targets: ["Authenticator"]),
],
dependencies: [
.package(url: "https://github.com/aws-amplify/amplify-swift", "2.8.1"..<"2.16.0"),
.package(url: "https://github.com/aws-amplify/amplify-swift", from: "2.16.0"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
import Foundation

public class ComponentInformation {
public static let version = "1.0.5"
public static let version = "1.0.6"
public static let name = "amplify-ui-swift-authenticator"
}
2 changes: 1 addition & 1 deletion Sources/Authenticator/Models/AuthenticatorState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class AuthenticatorState: ObservableObject, AuthenticatorStateProtocol {
}

func setCurrentStep(_ step: Step) {
if case .error(let error) = step {
if case .error(let error) = self.step {
log.error(error)
log.error("Cannot move to \(step), the Authenticator is in error state.")
return
Expand Down
6 changes: 6 additions & 0 deletions Sources/Authenticator/States/AuthenticatorBaseState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public class AuthenticatorBaseState: ObservableObject {
log.verbose("User has attributes pending verification: \(unverifiedAttributes)")
return .verifyUser(attributes: unverifiedAttributes)
}
case .confirmSignInWithTOTPCode,
.continueSignInWithTOTPSetup(_):
log.error("The Authenticator does not yet support TOTP workflows.")
fallthrough
default:
throw AuthError.unknown("Unsupported next step: \(result.nextStep)", nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ class MockAuthenticationService: AuthenticationService {
func forgetDevice(_ device: AuthDevice?, options: AuthForgetDeviceRequest.Options?) async throws {}

func rememberDevice(options: AuthRememberDeviceRequest.Options?) async throws {}

// MARK: - TOTP

func setUpTOTP() async throws -> TOTPSetupDetails {
return .init(sharedSecret: "", username: "")
}

func verifyTOTPSetup(code: String, options: VerifyTOTPSetupRequest.Options?) async throws {}
}

extension MockAuthenticationService {
Expand Down