Skip to content

Commit

Permalink
fix(Auth): properly redacting session information (#3472)
Browse files Browse the repository at this point in the history
* fix(Auth): properly redacting session information

* missing a bracket
  • Loading branch information
harsh62 authored Jan 15, 2024
1 parent a961c64 commit f9b02de
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ extension AmplifyAuthTask where Self: DefaultLogger {
do {
log.info("Starting execution for \(eventName)")
let valueReturned = try await execute()
log.info("Successfully completed execution for \(eventName) with result:\n\(prettify(valueReturned))")
log.info("Successfully completed execution for \(eventName) with result:\n\(valueReturned)")
dispatch(result: .success(valueReturned))
return valueReturned
} catch let error as Failure {
log.error("Failed execution for \(eventName) with error:\n\(prettify(error))")
log.error("Failed execution for \(eventName) with error:\n\(error)")
dispatch(result: .failure(error))
throw error
}
Expand All @@ -47,10 +47,4 @@ extension AmplifyAuthTask where Self: DefaultLogger {
let payload = HubPayload(eventName: eventName, context: nil, data: result)
Amplify.Hub.dispatch(to: channel, payload: payload)
}

private func prettify<T>(_ value: T) -> String {
var result = ""
dump(value, to: &result)
return result
}
}

0 comments on commit f9b02de

Please sign in to comment.