Store server string in Account model after removing path

This commit is contained in:
Angelo Stavrow 2020-10-06 17:01:54 -04:00
parent 5b0874f14f
commit db5366b607
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -94,11 +94,11 @@ extension WriteFreelyModel {
serverString = serverString.replacingOccurrences(of: insecureProtocolPrefix, with: secureProtocolPrefix)
}
isLoggingIn = true
account.server = serverString
var serverURL = URL(string: serverString)!
if !serverURL.path.isEmpty {
serverURL.deleteLastPathComponent()
}
account.server = serverURL.absoluteString
client = WFClient(for: serverURL)
client?.login(username: username, password: password, completion: loginHandler)
}