Spaces:
Running
Running
Update public_src/app.py
Browse files- public_src/app.py +5 -5
public_src/app.py
CHANGED
@@ -41,11 +41,11 @@ app.add_middleware(SessionMiddleware, secret_key=APP_SECRET_KEY, https_only=True
|
|
41 |
class ResetSessionMiddleware(BaseHTTPMiddleware):
|
42 |
async def dispatch(self, request, call_next):
|
43 |
response = await call_next(request)
|
44 |
-
if
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
request.session.modified = True
|
50 |
return response
|
51 |
|
|
|
41 |
class ResetSessionMiddleware(BaseHTTPMiddleware):
|
42 |
async def dispatch(self, request, call_next):
|
43 |
response = await call_next(request)
|
44 |
+
if request.session.get('user'):
|
45 |
+
if isinstance(request.session, dict):
|
46 |
+
# セッションを辞書オブジェクトとして扱う場合の処理
|
47 |
+
request.session['modified'] = True
|
48 |
+
else:
|
49 |
request.session.modified = True
|
50 |
return response
|
51 |
|