From b513ec38dc6e78544d801975720b68dc0cbe2874 Mon Sep 17 00:00:00 2001 From: mormaer Date: Sat, 23 Sep 2023 22:01:07 +0100 Subject: [PATCH] fix - do not pass 'localhost' when present in get user request (#643) --- Mlem/API/Requests/Person/GetPersonDetails.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mlem/API/Requests/Person/GetPersonDetails.swift b/Mlem/API/Requests/Person/GetPersonDetails.swift index a16f5654d..64072843f 100644 --- a/Mlem/API/Requests/Person/GetPersonDetails.swift +++ b/Mlem/API/Requests/Person/GetPersonDetails.swift @@ -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))