Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Coder-Desktop/Coder-Desktop/Views/LoginForm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ func validateURL(_ url: String) throws(LoginError) -> URL {
guard let url = URL(string: url) else {
throw .invalidURL
}
guard url.scheme == "https" else {
throw .httpsRequired
guard url.scheme == "https" || url.scheme == "http" else {
throw .invalidScheme
}
guard url.host != nil else {
throw .noHost
Expand All @@ -204,7 +204,7 @@ func validateURL(_ url: String) throws(LoginError) -> URL {
}

enum LoginError: Error {
case httpsRequired
case invalidScheme
case noHost
case invalidURL
case outdatedCoderVersion
Expand All @@ -213,12 +213,12 @@ enum LoginError: Error {

var description: String {
switch self {
case .httpsRequired:
"URL must use HTTPS"
case .invalidScheme:
"Coder URL must use HTTPS or HTTP"
case .noHost:
"URL must have a host"
"Coder URL must have a host"
case .invalidURL:
"Invalid URL"
"Invalid Coder URL"
case .outdatedCoderVersion:
"""
The Coder deployment must be version \(Validator.minimumCoderVersion)
Expand Down
Loading