@@ -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
|
||||
|
||||
Reference in New Issue
Block a user