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): Fixing the Gen2 json configuration used by the Authenticator #3647

Merged
merged 2 commits into from
Apr 26, 2024
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
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
])
lawmicha marked this conversation as resolved.
Show resolved Hide resolved
])
}
}
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
Loading