totp debugging
This commit is contained in:
parent
f248550a6b
commit
27c8a2324a
1 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue