don't allow login for removed hosts

This commit is contained in:
4cuck committed 2023-10-17 00:17:10 +02:00
1 parent 955b99fea9
commit 25ea70a90d
1 file changed
+6
+6
View File
@@ -58,6 +58,8 @@ pub enum LoginError {
KeyMismatch,
#[error("No public instance host found with domain '{0}'")]
HostNotFound(String),
#[error("Host is not in the public instances listed right now")]
DisabledHost(String),
#[error("Server responded with status code '{0}'")]
ServerResponse(u16, String),
#[error("Invalid hash found")]
@@ -154,6 +156,10 @@ async fn login_inner(
) -> LoginResult<host::Model> {
let host = host.ok_or_else(|| LoginError::HostNotFound(input.domain.clone()))?;
if !host.enabled {
return Err(LoginError::DisabledHost(input.domain.clone()));
}
match input.verification_method {
VerificationMethod::DNS => {
let entries = fetch_host_dns(&host.domain, &config).await?;