feat(api): PATCH /settings uses OAuth session + same-origin

This commit is contained in:
shay
2026-04-19 18:59:46 -04:00
parent eb4b68bf0d
commit 4ee71e0b86
2 changed files with 45 additions and 13 deletions
+2 -2
View File
@@ -575,7 +575,6 @@ def enroll_endpoint():
@app.route("/api/<username>/settings", methods=["GET"])
@rate_limited("read")
@require_edit_token
def get_settings(username: str):
s = db.get_settings(username)
if s is None:
@@ -591,7 +590,8 @@ def get_settings(username: str):
@app.route("/api/<username>/settings", methods=["PATCH"])
@rate_limited("mutate")
@require_edit_token
@auth.require_same_origin
@auth.require_github_owner
def patch_settings(username: str):
current = db.get_settings(username)
if current is None: