diff options
| author | altaf-creator <dev@altafcreator.com> | 2025-12-29 22:50:29 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2025-12-29 22:50:29 +0800 |
| commit | 55a8e43f708704dd7cb15788b03a98d851e8b0ef (patch) | |
| tree | b1ee0ce49988c9463cc0495529d3653256cfc5a2 /backend | |
| parent | 3e682cc889c5aa7b1d33c20acfd3d9bc2ea5d6dd (diff) | |
This does not make any sense.
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/main.py | 5 | ||||
| -rw-r--r-- | backend/notif.py | 1 |
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] |
