Skip to content

Commit

Permalink
fix(Auth): Fixing the Gen2 json configuration used by the Authenticat…
Browse files Browse the repository at this point in the history
…or (#3647)

---------

Co-authored-by: Michael Law <[email protected]>
  • Loading branch information
ruisebas and lawmicha authored Apr 26, 2024
1 parent 162847a commit 2b2856a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct ConfigurationHelper {
AuthPluginErrorConstants.configurationMissingError
)
}
let userPoolConfig = try parseUserPoolData(config)
let userPoolConfig = parseUserPoolData(config)
let identityPoolConfig = parseIdentityPoolData(config)

return try createAuthConfiguration(userPoolConfig: userPoolConfig,
Expand Down Expand Up @@ -281,11 +281,10 @@ struct ConfigurationHelper {
"verificationMechanism": .array(verificationMechanisms)])
}

return JSONValue.object(
["auth": .object(
["plugins": .object(
["awsCognitoAuthPlugin": .object(
["Auth": .object(
["Default": authConfigObject])])])])])
return JSONValue.object([
"Auth": .object([
"Default": authConfigObject
])
])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ final class ConfigurationHelperTests: XCTestCase {
]))
let json = ConfigurationHelper.createUserPoolJsonConfiguration(config)

guard let authConfig = json.auth?.plugins?.awsCognitoAuthPlugin?.Auth?.Default else {
guard let authConfig = json.Auth?.Default else {
XCTFail("Could not retrieve auth configuration from json")
return
}
Expand Down

0 comments on commit 2b2856a

Please sign in to comment.