// // Copyright Amazon.com Inc. or its affiliates. // All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // import Amplify import AWSPluginsCore import Foundation struct InformSessionRefreshed: Action { let identifier = "InformSessionRefreshed" let credentials: AmplifyCredentials func execute(withDispatcher dispatcher: EventDispatcher, environment: Environment) async { logVerbose("\(#fileID) Starting execution", environment: environment) let event = AuthorizationEvent(eventType: .refreshed(credentials)) logVerbose("\(#fileID) Sending event \(event.type)", environment: environment) await dispatcher.send(event) } } extension InformSessionRefreshed: DefaultLogger { public static var log: Logger { Amplify.Logging.logger(forCategory: CategoryType.auth.displayName, forNamespace: String(describing: self)) } public var log: Logger { Self.log } } extension InformSessionRefreshed: CustomDebugDictionaryConvertible { var debugDictionary: [String: Any] { [ "identifier": identifier, "credentials": credentials.debugDescription ] } } extension InformSessionRefreshed: CustomDebugStringConvertible { var debugDescription: String { debugDictionary.debugDescription } }