validate UserId more

This commit is contained in:
2022-04-24 22:56:56 +02:00
parent 9687490c8e
commit b045bfb321
3 changed files with 17 additions and 6 deletions

View File

@ -70,9 +70,6 @@ async fn post_register(
let (user, device) = match &body.auth().unwrap() {
AuthenticationData::Password(auth_data) => {
// let username = match auth_data.identifier() {
// Identifier::User(user_identifier) => user_identifier.user().unwrap(),
// };
let username = body.username().unwrap();
let user_id = UserId::new(&username, &config.homeserver_name).unwrap();
if User::exists(&db, &user_id).await.unwrap() {
@ -95,7 +92,6 @@ async fn post_register(
}
};
// dont log in the user after registration
if *&body.inhibit_login().is_some() && *&body.inhibit_login().unwrap() {
let resp = RegistrationSuccess::new(None, device.device_id(), user.user_id());