Move metadata from AuthChangePasswordRequest to plugin options
Describe the bug
metadata field for different request were placed inside the plugin options of the request inside the plugin. For example:
AuthConfirmSignInRequest request option looks like this:
public extension AuthConfirmSignInRequest {
struct Options {
/// Extra plugin specific options, only used in special circumstances when the existing options do not provide
/// a way to utilize the underlying auth plugin functionality. See plugin documentation for expected
/// key/values
public let pluginOptions: Any?
public init(pluginOptions: Any? = nil) {
self.pluginOptions = pluginOptions
}
}
}
And the plugin option for signIn request has the metadata:
public struct AWSAuthConfirmSignInOptions {
public let userAttributes: [AuthUserAttribute]?
public let metadata: [String: String]?
public init(userAttributes: [AuthUserAttribute]? = nil, metadata: [String: String]? = nil) {
self.userAttributes = userAttributes
self.metadata = metadata
}
}
Issue
The metadata for AuthChangePasswordRequest is in the request itself. We need to move this to a pluginOptions
public extension AuthChangePasswordRequest {
struct Options {
public let metadata: [String: String]?
public init(metadata: [String: String]? = nil) {
self.metadata = metadata
}
}
}
This will be a breaking change, we might wait till the next major release.
This issue is stale because it has been open for 14 days with no activity. Please, provide an update or it will be automatically closed in 7 days.
Fixed here - https://github.com/aws-amplify/amplify-ios/pull/1928
Released this in v2.0.0