From 70e5b4ec6fbd3c30938436e565b315d148737cca Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 12 Nov 2020 13:17:15 -0500 Subject: [PATCH] update buckler middleware --- buckler_aiohttp.py | 6 ++++-- config.py.template | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/buckler_aiohttp.py b/buckler_aiohttp.py index db321aa..2281126 100644 --- a/buckler_aiohttp.py +++ b/buckler_aiohttp.py @@ -24,8 +24,7 @@ async def buckler_session(request, handler): 'app_id': config.buckler['app_id'], 'app_key': config.buckler['app_key'], 'userid': user_id, - 'session': user_sid - } + 'session': user_sid } async with aiohttp.ClientSession() as session: async with session.get(url, params=params) as resp: data = await resp.json() @@ -34,6 +33,7 @@ async def buckler_session(request, handler): resp.set_cookie( 'redirect', request.url, + domain=config.server_domain, secure=True, httponly=True) #samesite='strict') @@ -55,6 +55,7 @@ async def buckler_session(request, handler): resp.set_cookie( 'userid', user_id, + domain=config.server_domain, max_age=30*24*60*60, secure=True, httponly=True) @@ -62,6 +63,7 @@ async def buckler_session(request, handler): resp.set_cookie( 'session', user_sid, + domain=config.server_domain, max_age=30*24*60*60, secure=True, httponly=True) diff --git a/config.py.template b/config.py.template index 087d5cb..25fab2f 100644 --- a/config.py.template +++ b/config.py.template @@ -3,11 +3,10 @@ Configuration settings for the Juice IOT hub server. `url_prefix` is the root path you wish app to reside at eg. https://example.com/juice. -`registration_open` whether or not new accounts may be registered. `buckler` specifies settings pertaining to the Buckler server. """ +server_domain = 'steelbea.me' url_prefix = '/juice' -registration_open = True buckler = { 'url': "http://127.0.0.1:5400/buckler", 'app_id': 2,