fix: login username case
how do people always run into the stupidest problems
This commit is contained in:
parent
4837da0cba
commit
fa1a609bf5
2 changed files with 6 additions and 2 deletions
|
@ -78,7 +78,7 @@ pub async fn register_request(
|
||||||
}
|
}
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
let mut user = User::new(props.username, props.password);
|
let mut user = User::new(props.username.to_lowercase(), props.password);
|
||||||
user.settings.policy_consent = true;
|
user.settings.policy_consent = true;
|
||||||
|
|
||||||
let (initial_token, t) = User::create_token(&real_ip);
|
let (initial_token, t) = User::create_token(&real_ip);
|
||||||
|
@ -133,7 +133,10 @@ pub async fn login_request(
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify password
|
// verify password
|
||||||
let user = match data.get_user_by_username_no_cache(&props.username).await {
|
let user = match data
|
||||||
|
.get_user_by_username_no_cache(&props.username.to_lowercase())
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(ua) => ua,
|
Ok(ua) => ua,
|
||||||
Err(_) => return (None, Json(Error::IncorrectPassword.into())),
|
Err(_) => return (None, Json(Error::IncorrectPassword.into())),
|
||||||
};
|
};
|
||||||
|
|
|
@ -1011,6 +1011,7 @@ impl DataManager {
|
||||||
// reposting but NOT quoting... we shouldn't be able to repost a direct repost
|
// reposting but NOT quoting... we shouldn't be able to repost a direct repost
|
||||||
data.context.reposts_enabled = false;
|
data.context.reposts_enabled = false;
|
||||||
data.context.reactions_enabled = false;
|
data.context.reactions_enabled = false;
|
||||||
|
data.context.comments_enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mirror nsfw status
|
// mirror nsfw status
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue