update buckler middleware
This commit is contained in:
parent
99eb1a2ef9
commit
c80fe8eac4
|
@ -76,13 +76,15 @@ class BucklerSessionInterface(SessionInterface):
|
||||||
session.cookies['userid'],
|
session.cookies['userid'],
|
||||||
max_age=30*24*60*60,
|
max_age=30*24*60*60,
|
||||||
secure=True,
|
secure=True,
|
||||||
httponly=True)
|
httponly=True,
|
||||||
|
samesite='strict')
|
||||||
response.set_cookie(
|
response.set_cookie(
|
||||||
'session',
|
'session',
|
||||||
session.cookies['session'],
|
session.cookies['session'],
|
||||||
max_age=30*24*60*60,
|
max_age=30*24*60*60,
|
||||||
secure=True,
|
secure=True,
|
||||||
httponly=True)
|
httponly=True,
|
||||||
|
samesite='strict')
|
||||||
|
|
||||||
|
|
||||||
class BucklerSession(dict, SessionMixin):
|
class BucklerSession(dict, SessionMixin):
|
||||||
|
@ -103,5 +105,10 @@ def require_auth():
|
||||||
"""
|
"""
|
||||||
if not hasattr(session, 'meta'):
|
if not hasattr(session, 'meta'):
|
||||||
resp = redirect(config.buckler['login_url'])
|
resp = redirect(config.buckler['login_url'])
|
||||||
resp.set_cookie('redirect', request.url)
|
resp.set_cookie(
|
||||||
|
'redirect',
|
||||||
|
request.url,
|
||||||
|
secure=True,
|
||||||
|
httponly=True,
|
||||||
|
samesite='strict')
|
||||||
return resp
|
return resp
|
||||||
|
|
Loading…
Reference in New Issue
Block a user