Skip to content

Commit

Permalink
LoginRemote: Fixes incorrect constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jleandroperez committed Jul 11, 2024
1 parent 2513a19 commit 8d76ccd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Simplenote/LoginRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
class LoginRemote: Remote {

func requestLoginEmail(email: String, completion: @escaping (_ result: Result<Data?, RemoteError>) -> Void) {
let request = requestForLoginRequest(with: email)
let request = requestForLoginRequest(email: email)
performDataTask(with: request, completion: completion)
}

Expand All @@ -28,19 +28,19 @@ struct LoginConfirmationResponse: Decodable {
//
private extension LoginRemote {

func requestForLoginRequest(with email: String) -> URLRequest {
func requestForLoginRequest(email: String) -> URLRequest {
let url = URL(string: SimplenoteConstants.loginRequestURL)!
return requestForURL(url, method: RemoteConstants.Method.POST, httpBody: [
"request_source": SimplenoteConstants.simplenotePlatformName,
"username": email.lowercased()
])
}

func requestForLoginCompletion(username: String, authCode: String) -> URLRequest {
func requestForLoginCompletion(email: String, authCode: String) -> URLRequest {
let url = URL(string: SimplenoteConstants.loginCompletionURL)!
return requestForURL(url, method: RemoteConstants.Method.POST, httpBody: [
"auth_key": authKey,
"username": username
"auth_code": authCode,
"username": email
])
}
}

0 comments on commit 8d76ccd

Please sign in to comment.