Upgrade Ruma
Co-authored-by: Timo Kösters <timo@koesters.xyz>
This commit is contained in:
parent
47f3263396
commit
09895a20c8
21 changed files with 628 additions and 623 deletions
|
@ -60,10 +60,10 @@ pub async fn login_route(
|
|||
// Validate login method
|
||||
// TODO: Other login methods
|
||||
let user_id = match &body.login_info {
|
||||
login::IncomingLoginInfo::Password {
|
||||
login::IncomingLoginInfo::Password(login::IncomingPassword {
|
||||
identifier,
|
||||
password,
|
||||
} => {
|
||||
}) => {
|
||||
let username = if let IncomingUserIdentifier::MatrixId(matrix_id) = identifier {
|
||||
matrix_id
|
||||
} else {
|
||||
|
@ -97,7 +97,7 @@ pub async fn login_route(
|
|||
|
||||
user_id
|
||||
}
|
||||
login::IncomingLoginInfo::Token { token } => {
|
||||
login::IncomingLoginInfo::Token(login::IncomingToken { token }) => {
|
||||
if let Some(jwt_decoding_key) = db.globals.jwt_decoding_key() {
|
||||
let token = jsonwebtoken::decode::<Claims>(
|
||||
token,
|
||||
|
@ -116,6 +116,12 @@ pub async fn login_route(
|
|||
));
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Unknown,
|
||||
"Unsupported login type.",
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
// Generate new device id if the user didn't specify one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue