@@ -321,12 +321,10 @@ func (h *Handler) CompleteAccountSetupPost(w http.ResponseWriter, r *http.Reques
321321 }
322322
323323 // Set password and email (doesn't require current password)
324- h .logger .Info ("🔧 DEBUG: Setting password and email" , "user_id" , user .ID , "new_email" , newEmail )
325324 if err := h .authManager .SetPasswordAndEmail (r , user .ID , newPassword , newEmail ); err != nil {
326325 http .Redirect (w , r , "/settings/complete-account-setup?error=" + url .QueryEscape (err .Error ()), http .StatusSeeOther )
327326 return
328327 }
329- h .logger .Info ("✅ DEBUG: Password and email set successfully" )
330328
331329 // SECURITY: Auto-delete admin credentials file after successful setup
332330 credentialsFile := "data/admin-credentials.txt" //#nosec G101 -- Not a credential; this is a file path constant
@@ -343,23 +341,19 @@ func (h *Handler) CompleteAccountSetupPost(w http.ResponseWriter, r *http.Reques
343341 }
344342
345343 // Get updated user record (with new email and cleared MustChangePassword flag)
346- h .logger .Info ("🔍 DEBUG: Fetching updated user record" , "user_id" , user .ID )
347344 updatedUser , err := h .authManager .GetDB ().GetUserByID (user .ID )
348345 if err != nil {
349346 h .logger .Error ("Failed to get updated user after account setup" , "error" , err )
350347 http .Redirect (w , r , "/settings/complete-account-setup?error=Setup+completed+but+session+error" , http .StatusSeeOther )
351348 return
352349 }
353- h .logger .Info ("📋 DEBUG: Updated user fetched" , "must_change_password" , updatedUser .MustChangePassword , "email" , updatedUser .Email )
354350
355351 // Create a fresh session with the updated user
356- h .logger .Info ("🔐 DEBUG: Creating fresh session for updated user" )
357352 if err := h .authManager .CreateSessionForUser (w , r , updatedUser ); err != nil {
358- h .logger .Error ("❌ FAILED to create session after account setup" , "error" , err )
353+ h .logger .Error ("failed to create session after account setup" , "error" , err )
359354 http .Redirect (w , r , "/login?message=Setup+complete.+Please+log+in." , http .StatusSeeOther )
360355 return
361356 }
362- h .logger .Info ("✅ DEBUG: Session created successfully, redirecting to /" )
363357
364358 http .Redirect (w , r , "/" , http .StatusSeeOther )
365359}
0 commit comments