amplify-swift icon indicating copy to clipboard operation
amplify-swift copied to clipboard

Move metadata from AuthChangePasswordRequest to plugin options

Open royjit opened this issue 5 years ago • 3 comments

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
        }
    }
}

royjit avatar Nov 19 '20 23:11 royjit

This will be a breaking change, we might wait till the next major release.

royjit avatar Nov 19 '20 23:11 royjit

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.

github-actions[bot] avatar Jun 19 '21 00:06 github-actions[bot]

Fixed here - https://github.com/aws-amplify/amplify-ios/pull/1928

royjit avatar Sep 21 '22 19:09 royjit

Released this in v2.0.0

royjit avatar Oct 20 '22 01:10 royjit