mirror of
https://github.com/4cuck/nitter-status.git
synced 2026-10-27 00:57:39 +00:00
don't allow login for removed hosts
This commit is contained in:
1 parent
955b99fea9
commit
25ea70a90d
1 file changed
+6
@@ -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?;
|
||||
|
||||
Reference in new issue
Block a user