Skip to content

Commit 426cf99

Browse files
committed
update comment
1 parent 478d460 commit 426cf99

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AuthFlowType.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ extension AuthFlowType: Codable {
137137
container = try decoder.container(keyedBy: CodingKeys.self)
138138
} catch DecodingError.typeMismatch {
139139
// The type mismatch has been added to handle a scenario where the user is migrating passwordless flows.
140-
// Passwordless flow added a new enum case with a associated type. The association resulted in encoding structure changes that is different from the non-passwordless flows.
140+
// Passwordless flow added a new enum case with a associated type.
141+
// The association resulted in encoding structure changes that is different from the non-passwordless flows.
141142
// The structure change causes the type mismatch exception and this code block tries to retrieve the legacy structure and decode it.
142143
let legacyContainer = try decoder.singleValueContainer()
143144
let type = try legacyContainer.decode(String.self)
@@ -167,7 +168,10 @@ extension AuthFlowType: Codable {
167168
if let preferredFirstFactor = AuthFactorType(rawValue: preferredFirstFactorString) {
168169
self = .userAuth(preferredFirstFactor: preferredFirstFactor)
169170
} else {
170-
throw DecodingError.dataCorruptedError(forKey: .preferredFirstFactor, in: container, debugDescription: "Unable to decode preferredFirstFactor value")
171+
throw DecodingError.dataCorruptedError(
172+
forKey: .preferredFirstFactor,
173+
in: container,
174+
debugDescription: "Unable to decode preferredFirstFactor value")
171175
}
172176
default:
173177
throw DecodingError.dataCorruptedError(forKey: .type, in: container, debugDescription: "Invalid AuthFlowType value")

0 commit comments

Comments
 (0)