validate UserId more
This commit is contained in:
@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user