Skip to content

Commit

Permalink
Merge pull request #2 from SkylerGodfrey/patch-1
Browse files Browse the repository at this point in the history
Update NetworkAuthManager.swift
  • Loading branch information
SkylerGodfrey authored Oct 26, 2024
2 parents d458eba + 82a6162 commit e679b14
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Source/Networking/NetworkAuthManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ actor NetworkAuthManager {
/// - Returns: The encoded data string for use with Basic Auth.
nonisolated func basicAuthString() throws -> String {
guard case .basicAuth(let username, let password) = authInfo,
!username.isEmpty && !password.isEmpty,
let result = "\(username):\(password)".data(using: .utf8)?.base64EncodedString(),
!result.isEmpty else {
!username.isEmpty && !password.isEmpty else {
throw AuthError.invalidUsernamePassword
}
return result
return Data("\(username):\(password)".utf8).base64EncodedString()
}
}

0 comments on commit e679b14

Please sign in to comment.