@@ -45,7 +45,7 @@ local function exec(self, func, ...)
4545 return nil , err
4646 end
4747
48- if red :get_reused_times () == 0 then
48+ if self . force_auth == true or red :get_reused_times () == 0 then
4949 local password = self .password
5050 if password then
5151 local username = self .username
@@ -99,11 +99,6 @@ local metatable = {}
9999metatable .__index = metatable
100100
101101
102- function metatable .__newindex ()
103- error (" attempt to update a read-only table" , 2 )
104- end
105-
106-
107102---
108103-- Store session data.
109104--
@@ -233,6 +228,8 @@ function storage.new(configuration)
233228 local ssl_verify = configuration and configuration .ssl_verify
234229 local server_name = configuration and configuration .server_name
235230
231+ local force_auth = configuration and configuration .force_auth
232+
236233 if ssl ~= nil or ssl_verify ~= nil or server_name or pool or pool_size or backlog then
237234 return setmetatable ({
238235 prefix = prefix ,
@@ -247,6 +244,7 @@ function storage.new(configuration)
247244 send_timeout = send_timeout ,
248245 read_timeout = read_timeout ,
249246 keepalive_timeout = keepalive_timeout ,
247+ force_auth = force_auth ,
250248 options = {
251249 ssl = ssl ,
252250 ssl_verify = ssl_verify ,
@@ -271,6 +269,7 @@ function storage.new(configuration)
271269 send_timeout = send_timeout ,
272270 read_timeout = read_timeout ,
273271 keepalive_timeout = keepalive_timeout ,
272+ force_auth = force_auth ,
274273 }, metatable )
275274end
276275
0 commit comments