summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/main.py5
-rw-r--r--backend/notif.py1
2 files changed, 4 insertions, 2 deletions
diff --git a/backend/main.py b/backend/main.py
index 72191a7..00cbd8c 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -34,7 +34,8 @@ origins = [
"http://127.0.0.1",
"http://127.0.0.1:998",
"http://127.0.0.1:5173",
- "https://laundryweb.altafcreator.com"
+ "https://laundryweb.altafcreator.com",
+ "https://backend.laundryweb.altafcreator.com"
]
app.add_middleware(
@@ -457,6 +458,6 @@ def uri_to_information(data: InformationRequestData, response: fastapi.Response,
@app.post("/notifsubscribe", response_class=PlainTextResponse)
def notif_subscribe(data: notif.PushSubscriptionData, response: fastapi.Response):
endpoint = notif.subscribe(data)
- response.set_cookie(key="sub_endpoint", value=endpoint, max_age=COOKIE_MAX_AGE, domain=".laundryweb.altafcreator.com", samesite="none", secure=True)
+ response.set_cookie(key="subscription_endpoint", value=endpoint, max_age=COOKIE_MAX_AGE, domain="laundryweb.altafcreator.com", samesite="none", secure=True, path="/")
response.status_code = fastapi.status.HTTP_200_OK
return "do i need to return something perhaps"
diff --git a/backend/notif.py b/backend/notif.py
index d2e1f2e..ef7ba34 100644
--- a/backend/notif.py
+++ b/backend/notif.py
@@ -39,6 +39,7 @@ def subscribe(data: PushSubscriptionData):
# --- send notification
+# ---- not used yet
def send_notification(endpoint: str):
cursor.execute("SELECT * FROM subscriptions WHERE endpoint = ?", (endpoint,))
row = cursor.fetchall()[0]