File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,8 @@ def get_user(cls, handler):
168
168
return handler ._user_id
169
169
user_id = cls .get_user_token (handler )
170
170
if user_id is None :
171
- user_id = handler .get_secure_cookie (handler .cookie_name )
171
+ get_secure_cookie_kwargs = handler .settings .get ('get_secure_cookie_kwargs' , {})
172
+ user_id = handler .get_secure_cookie (handler .cookie_name , ** get_secure_cookie_kwargs )
172
173
else :
173
174
cls .set_login_cookie (handler , user_id )
174
175
# Record that the current request has been authenticated with a token.
Original file line number Diff line number Diff line change @@ -945,6 +945,10 @@ def _update_webapp_settings(self, change):
945
945
help = _ ("Extra keyword arguments to pass to `set_secure_cookie`."
946
946
" See tornado's set_secure_cookie docs for details." )
947
947
)
948
+ get_secure_cookie_kwargs = Dict (config = True ,
949
+ help = _ ("Extra keyword arguments to pass to `get_secure_cookie`."
950
+ " See tornado's get_secure_cookie docs for details." )
951
+ )
948
952
ssl_options = Dict (config = True ,
949
953
help = _ ("""Supply SSL options for the tornado HTTPServer.
950
954
See the tornado docs for details.""" ))
@@ -1338,6 +1342,7 @@ def init_webapp(self):
1338
1342
self .tornado_settings ['allow_origin_pat' ] = re .compile (self .allow_origin_pat )
1339
1343
self .tornado_settings ['allow_credentials' ] = self .allow_credentials
1340
1344
self .tornado_settings ['cookie_options' ] = self .cookie_options
1345
+ self .tornado_settings ['get_secure_cookie_kwargs' ] = self .get_secure_cookie_kwargs
1341
1346
self .tornado_settings ['token' ] = self .token
1342
1347
if (self .open_browser or self .file_to_run ) and not self .password :
1343
1348
self .one_time_token = binascii .hexlify (os .urandom (24 )).decode ('ascii' )
You can’t perform that action at this time.
0 commit comments