cargo fmt
This commit is contained in:
parent
33a2b2b772
commit
a4637e2ba1
119 changed files with 2787 additions and 1761 deletions
|
@ -3,10 +3,17 @@ use std::sync::Arc;
|
|||
|
||||
pub use data::Data;
|
||||
|
||||
use ruma::{api::client::{uiaa::{UiaaInfo, IncomingAuthData, IncomingPassword, AuthType, IncomingUserIdentifier}, error::ErrorKind}, DeviceId, UserId, signatures::CanonicalJsonValue};
|
||||
use ruma::{
|
||||
api::client::{
|
||||
error::ErrorKind,
|
||||
uiaa::{AuthType, IncomingAuthData, IncomingPassword, IncomingUserIdentifier, UiaaInfo},
|
||||
},
|
||||
signatures::CanonicalJsonValue,
|
||||
DeviceId, UserId,
|
||||
};
|
||||
use tracing::error;
|
||||
|
||||
use crate::{Result, utils, Error, services, api::client_server::SESSION_ID_LENGTH};
|
||||
use crate::{api::client_server::SESSION_ID_LENGTH, services, utils, Error, Result};
|
||||
|
||||
pub struct Service {
|
||||
db: Arc<dyn Data>,
|
||||
|
@ -68,11 +75,11 @@ impl Service {
|
|||
}
|
||||
};
|
||||
|
||||
let user_id =
|
||||
UserId::parse_with_server_name(username.clone(), services().globals.server_name())
|
||||
.map_err(|_| {
|
||||
Error::BadRequest(ErrorKind::InvalidParam, "User ID is invalid.")
|
||||
})?;
|
||||
let user_id = UserId::parse_with_server_name(
|
||||
username.clone(),
|
||||
services().globals.server_name(),
|
||||
)
|
||||
.map_err(|_| Error::BadRequest(ErrorKind::InvalidParam, "User ID is invalid."))?;
|
||||
|
||||
// Check if password is correct
|
||||
if let Some(hash) = services().users.password_hash(&user_id)? {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue