Skip to content

Commit

Permalink
Refactored account remote requesting passkey to convert data once
Browse files Browse the repository at this point in the history
  • Loading branch information
charliescheer committed Jul 1, 2024
1 parent 21c7469 commit b63e8d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Simplenote/AccountRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ class AccountRemote: Remote {
}

private func body(with boundary: String, parameters: [String: Any]) -> Data {
var body = Data()
var body = String()

for param in parameters {
let paramName = param.key
body += Data("--\(boundary)\r\n".utf8)
body += Data("Content-Disposition:form-data; name=\"\(paramName)\"".utf8)
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
let paramValue = param.value as! String
body += Data("\r\n\r\n\(paramValue)\r\n".utf8)
body += "\r\n\r\n\(paramValue)\r\n"
}

body += Data("--\(boundary)--\r\n".utf8)
body += "--\(boundary)--\r\n"

return body
return Data(body.utf8)
}

func requestChallengeResponseToCreatePasskey(forEmail email: String, password: String) async throws -> Data? {
Expand Down

0 comments on commit b63e8d0

Please sign in to comment.