6 totp = ROTP::TOTP.new("<%= @totp_key %>", :interval => 3600)
8 STDIN.each_line do |header|
9 cookies = CGI::Cookie.parse(header.chomp)
11 if cookie = cookies.fetch("_osm_totp_token", nil)
12 if totp.verify(cookie.value.first, :drift_behind => 3600, :drift_ahead => 3600)
13 STDOUT.syswrite("1\n")
15 STDOUT.syswrite("0\n")
18 STDOUT.syswrite("0\n")