mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
chore: Reformat with latest nightly
This commit is contained in:
113 files changed
+981
-831
No files matched your search
@@ -120,8 +120,8 @@ async fn route_change_email(
|
||||
{
|
||||
| Ok(session_id) => session_id,
|
||||
| Err(err) => {
|
||||
// If we couldn't send an email, generate a random session ID to not give that
|
||||
// away
|
||||
// If we couldn't send an email, generate a random session ID to
|
||||
// not give that away
|
||||
warn!(
|
||||
"Failed to send email change message for {user_id} to {}: {err}",
|
||||
form.email
|
||||
|
||||
@@ -130,7 +130,8 @@ async fn route_login(
|
||||
if let Some(form) = form {
|
||||
let login_result = match (user_id, form.identifier) {
|
||||
| (Some(user_id), _) => {
|
||||
// The user is already authenticated, we need to check their password
|
||||
// The user is already authenticated, we need to check their
|
||||
// password
|
||||
services
|
||||
.users
|
||||
.check_password(&user_id, &form.password)
|
||||
|
||||
@@ -117,8 +117,8 @@ async fn route_reset_password(
|
||||
}
|
||||
.await
|
||||
.unwrap_or_else(|| {
|
||||
// If we couldn't send an email, generate a random session ID to not give that
|
||||
// away
|
||||
// If we couldn't send an email, generate a random session ID to not
|
||||
// give that away
|
||||
ValidationSessions::generate_session_id()
|
||||
});
|
||||
|
||||
|
||||
@@ -186,8 +186,8 @@ async fn route_register(
|
||||
if let Some(username) = &query.username
|
||||
&& query.from_landing
|
||||
{
|
||||
// Check if the username is valid and available before showing the details form
|
||||
// to keep the user from wasting their time
|
||||
// Check if the username is valid and available before showing the
|
||||
// details form to keep the user from wasting their time
|
||||
|
||||
if let Err(err) = services
|
||||
.users
|
||||
@@ -382,10 +382,12 @@ async fn begin_registration(
|
||||
registration_token = Some(valid_token);
|
||||
},
|
||||
| RequestedRegistrationFlow::Untrusted => {
|
||||
// Don't check auth for the untrusted flow at all if open reg is enabled
|
||||
// Don't check auth for the untrusted flow at all if open reg is
|
||||
// enabled
|
||||
if !open_registration {
|
||||
// If the form claims to be using the untrusted flow, it _may_ need to have a
|
||||
// reCAPTCHA response if reCAPTCHA is configured
|
||||
// If the form claims to be using the untrusted flow, it _may_
|
||||
// need to have a reCAPTCHA response if reCAPTCHA is
|
||||
// configured
|
||||
|
||||
if let Some(recaptcha_private_site_key) =
|
||||
&services.config.recaptcha_private_site_key
|
||||
|
||||
@@ -99,9 +99,9 @@ impl UserSession {
|
||||
if let Ok(duration) = now.duration_since(self.last_login) {
|
||||
duration < Self::RECENT_LOGIN_THRESHOLD
|
||||
} else {
|
||||
// Clock drift might cause the last login time to be later than the current
|
||||
// system time. We play it safe and say the session isn't recent if that
|
||||
// happens.
|
||||
// Clock drift might cause the last login time to be later than the
|
||||
// current system time. We play it safe and say the session isn't
|
||||
// recent if that happens.
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user