diff --git a/lib/towerops/accounts.ex b/lib/towerops/accounts.ex index c86b91da..bf1b19b2 100644 --- a/lib/towerops/accounts.ex +++ b/lib/towerops/accounts.ex @@ -210,16 +210,16 @@ defmodule Towerops.Accounts do expected_code_current = NimbleTOTP.verification_code(secret, time: current_time) expected_code_prev = NimbleTOTP.verification_code(secret, time: current_time - 30) expected_code_next = NimbleTOTP.verification_code(secret, time: current_time + 30) + current_datetime = DateTime.from_unix!(current_time) - Logger.info("TOTP verification failed", - provided_code: code, - provided_code_length: String.length(code), - expected_code_current: expected_code_current, - expected_code_prev: expected_code_prev, - expected_code_next: expected_code_next, - current_unix_time: current_time, - current_datetime: DateTime.from_unix!(current_time), - secret_length: String.length(secret) + Logger.info( + "TOTP verification failed: " <> + "provided=#{code} (len=#{String.length(code)}), " <> + "expected_current=#{expected_code_current}, " <> + "expected_prev=#{expected_code_prev} (-30s), " <> + "expected_next=#{expected_code_next} (+30s), " <> + "server_time=#{current_datetime} (unix=#{current_time}), " <> + "secret_len=#{String.length(secret)}" ) end