full handle login

This commit is contained in:
Lumaa 2024-07-16 16:13:55 +02:00
parent fca89a52d5
commit 3d392fd99e

View File

@ -209,9 +209,14 @@ struct AddInstanceView: View {
}
private func signIn() async {
let cleanInstance = instanceUrl
.replacingOccurrences(of: "http://", with: "")
.replacingOccurrences(of: "https://", with: "")
var cleanInstance = self.instanceUrl
if instanceUrl.contains("@") {
cleanInstance = String(instanceUrl.split(separator: "@")[1]) // instance
} else {
cleanInstance = instanceUrl
.replacingOccurrences(of: "http://", with: "")
.replacingOccurrences(of: "https://", with: "")
}
signInClient = .init(server: cleanInstance)
if let oauthURL = try? await signInClient?.oauthURL(),