From 9af94556931e6102a214bdd4ed6266d64d9a5729 Mon Sep 17 00:00:00 2001 From: Vinson Zou Date: Thu, 29 Aug 2019 11:53:11 +0800 Subject: [PATCH] update: fix global variables --- otp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/otp.lua b/otp.lua index e5c3719..fb75e50 100644 --- a/otp.lua +++ b/otp.lua @@ -118,7 +118,7 @@ end function TOTP_MT:calc_token() local ngx_time = math.floor(ngx.time() / 30) - HMAC_Result_Final = {ngx.hmac_sha1(self.key_decoded, totp_time_calc(ngx_time)):byte(1, -1)} + local HMAC_Result_Final = {ngx.hmac_sha1(self.key_decoded, totp_time_calc(ngx_time)):byte(1, -1)} local HMAC_Offset = band(HMAC_Result_Final[20], 0xF) @@ -172,4 +172,4 @@ function TOTP_MT:serialize() } end -return _M \ No newline at end of file +return _M