signin is modified

This commit is contained in:
병준 박 2022-08-29 05:17:57 +00:00
parent 388a8ef177
commit d0c55c838a

View File

@ -766,6 +766,24 @@ impl Service<'_> {
} }
}; };
match m.state {
repositories::member::schema::MemberState::Normal => {}
_ => {
return Err(bcr::error::rpc::Error::InvalidParams(
bcr::error::rpc::InvalidParams {
message: "not permitted username".to_string(),
detail: bcr::error::rpc::InvalidParamsDetail {
location: "request".to_string(),
param: "username".to_string(),
value: username,
error_type: bcr::error::rpc::InvalidParamsType::None,
message: "cannot signin".to_string(),
},
},
));
}
}
if !(argon2::verify_encoded(&m.password, password.as_bytes()).map_err(|e| { if !(argon2::verify_encoded(&m.password, password.as_bytes()).map_err(|e| {
bcr::error::rpc::Error::InvalidParams(bcr::error::rpc::InvalidParams { bcr::error::rpc::Error::InvalidParams(bcr::error::rpc::InvalidParams {
message: "invalid password".to_string(), message: "invalid password".to_string(),