Skip to content

Commit

Permalink
fix - do not pass 'localhost' when present in get user request (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
mormaer authored Sep 23, 2023
1 parent 69032a1 commit b513ec3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Mlem/API/Requests/Person/GetPersonDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ struct GetPersonDetailsRequest: APIGetRequest {
guard let host = instanceURL.host() else {
throw GetPersonDetailsRequestError.unableToDetermineInstanceHost
}
username = "\(username)@\(host)"

// when logging into a locally running instance, we don't want to pass `user@localhost`
username = host == "localhost" ? username : "\(username)@\(host)"
}

queryItems.append(.init(name: "username", value: username))
Expand Down

0 comments on commit b513ec3

Please sign in to comment.