@@ -190,7 +190,7 @@ pub(crate) async fn post(
190190 // First, lookup the user
191191 let Some ( user) = get_user_by_email_or_by_username ( site_config, & mut repo, username) . await ?
192192 else {
193- tracing:: warn!( "User not found: {username} " ) ;
193+ tracing:: warn!( username , "User not found" ) ;
194194 let form_state = form_state. with_error_on_form ( FormError :: InvalidCredentials ) ;
195195 PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
196196 return render (
@@ -209,7 +209,7 @@ pub(crate) async fn post(
209209
210210 // Check the rate limit
211211 if let Err ( e) = limiter. check_password ( requester, & user) {
212- tracing:: warn!( error = & e as & dyn std:: error:: Error ) ;
212+ tracing:: warn!( error = & e as & dyn std:: error:: Error , "ratelimit exceeded" ) ;
213213 let form_state = form_state. with_error_on_form ( FormError :: RateLimitExceeded ) ;
214214 PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
215215 return render (
@@ -230,7 +230,7 @@ pub(crate) async fn post(
230230 let Some ( user_password) = repo. user_password ( ) . active ( & user) . await ? else {
231231 // There is no password for this user, but we don't want to disclose that. Show
232232 // a generic 'invalid credentials' error instead
233- tracing:: warn!( "No password for user: {user} " ) ;
233+ tracing:: warn!( username , "No password for user" ) ;
234234 let form_state = form_state. with_error_on_form ( FormError :: InvalidCredentials ) ;
235235 PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
236236 return render (
@@ -274,7 +274,7 @@ pub(crate) async fn post(
274274 }
275275 Ok ( PasswordVerificationResult :: Success ( None ) ) => user_password,
276276 Ok ( PasswordVerificationResult :: Failure ) => {
277- tracing:: warn!( "Failed to verify/upgrade password for user: {user} " ) ;
277+ tracing:: warn!( username , "Failed to verify/upgrade password for user" ) ;
278278 let form_state = form_state. with_error_on_form ( FormError :: InvalidCredentials ) ;
279279 PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "mismatch" ) ] ) ;
280280 return render (
@@ -296,7 +296,7 @@ pub(crate) async fn post(
296296 // Now that we have checked the user password, we now want to show an error if
297297 // the user is locked or deactivated
298298 if user. deactivated_at . is_some ( ) {
299- tracing:: warn!( "User is deactivated: {user} " ) ;
299+ tracing:: warn!( username , "User is deactivated" ) ;
300300 PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
301301 let ( csrf_token, cookie_jar) = cookie_jar. csrf_token ( & clock, & mut rng) ;
302302 let ctx = AccountInactiveContext :: new ( user)
@@ -307,7 +307,7 @@ pub(crate) async fn post(
307307 }
308308
309309 if user. locked_at . is_some ( ) {
310- tracing:: warn!( "User is locked: {user} " ) ;
310+ tracing:: warn!( username , "User is locked" ) ;
311311 PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
312312 let ( csrf_token, cookie_jar) = cookie_jar. csrf_token ( & clock, & mut rng) ;
313313 let ctx = AccountInactiveContext :: new ( user)
0 commit comments