@@ -190,7 +190,7 @@ pub(crate) async fn post(
190
190
// First, lookup the user
191
191
let Some ( user) = get_user_by_email_or_by_username ( site_config, & mut repo, username) . await ?
192
192
else {
193
- tracing:: warn!( "User not found: {username} " ) ;
193
+ tracing:: warn!( username , "User not found" ) ;
194
194
let form_state = form_state. with_error_on_form ( FormError :: InvalidCredentials ) ;
195
195
PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
196
196
return render (
@@ -209,7 +209,7 @@ pub(crate) async fn post(
209
209
210
210
// Check the rate limit
211
211
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" ) ;
213
213
let form_state = form_state. with_error_on_form ( FormError :: RateLimitExceeded ) ;
214
214
PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
215
215
return render (
@@ -230,7 +230,7 @@ pub(crate) async fn post(
230
230
let Some ( user_password) = repo. user_password ( ) . active ( & user) . await ? else {
231
231
// There is no password for this user, but we don't want to disclose that. Show
232
232
// a generic 'invalid credentials' error instead
233
- tracing:: warn!( "No password for user: {user} " ) ;
233
+ tracing:: warn!( username , "No password for user" ) ;
234
234
let form_state = form_state. with_error_on_form ( FormError :: InvalidCredentials ) ;
235
235
PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
236
236
return render (
@@ -274,7 +274,7 @@ pub(crate) async fn post(
274
274
}
275
275
Ok ( PasswordVerificationResult :: Success ( None ) ) => user_password,
276
276
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" ) ;
278
278
let form_state = form_state. with_error_on_form ( FormError :: InvalidCredentials ) ;
279
279
PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "mismatch" ) ] ) ;
280
280
return render (
@@ -296,7 +296,7 @@ pub(crate) async fn post(
296
296
// Now that we have checked the user password, we now want to show an error if
297
297
// the user is locked or deactivated
298
298
if user. deactivated_at . is_some ( ) {
299
- tracing:: warn!( "User is deactivated: {user} " ) ;
299
+ tracing:: warn!( username , "User is deactivated" ) ;
300
300
PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
301
301
let ( csrf_token, cookie_jar) = cookie_jar. csrf_token ( & clock, & mut rng) ;
302
302
let ctx = AccountInactiveContext :: new ( user)
@@ -307,7 +307,7 @@ pub(crate) async fn post(
307
307
}
308
308
309
309
if user. locked_at . is_some ( ) {
310
- tracing:: warn!( "User is locked: {user} " ) ;
310
+ tracing:: warn!( username , "User is locked" ) ;
311
311
PASSWORD_LOGIN_COUNTER . add ( 1 , & [ KeyValue :: new ( RESULT , "error" ) ] ) ;
312
312
let ( csrf_token, cookie_jar) = cookie_jar. csrf_token ( & clock, & mut rng) ;
313
313
let ctx = AccountInactiveContext :: new ( user)
0 commit comments