use bcrypt::verify;
use lemmy_api_common::{
person::{Login, LoginResponse},
- utils::{blocking, check_registration_application},
+ utils::{blocking, check_registration_application, check_user_valid},
};
use lemmy_db_schema::source::site::Site;
use lemmy_db_views::structs::LocalUserView;
-use lemmy_utils::{claims::Claims, ConnectionId, LemmyError};
+use lemmy_utils::{claims::Claims, error::LemmyError, ConnectionId};
use lemmy_websocket::LemmyContext;
#[async_trait::async_trait(?Send)]
if !valid {
return Err(LemmyError::from_message("password_incorrect"));
}
+ check_user_valid(
+ local_user_view.person.banned,
+ local_user_view.person.ban_expires,
+ local_user_view.person.deleted,
+ )?;
- let site = blocking(context.pool(), Site::read_local_site).await??;
+ let site = blocking(context.pool(), Site::read_local).await??;
if site.require_email_verification && !local_user_view.local_user.email_verified {
return Err(LemmyError::from_message("email_not_verified"));
}