From 0dde2ac6d816b48629049603e0ff7025ac393cb5 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 3 Aug 2021 20:22:22 +0200 Subject: [PATCH] fdfd --- drama/routes/oauth.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drama/routes/oauth.py b/drama/routes/oauth.py index af0c933d4..16283b14c 100644 --- a/drama/routes/oauth.py +++ b/drama/routes/oauth.py @@ -206,4 +206,20 @@ def admin_apps_list(v): apps = g.db.query(OauthApp).all() - return render_template("admin/apps.html", v=v, apps=apps) \ No newline at end of file + return render_template("admin/apps.html", v=v, apps=apps) + + +@app.post("/oauth/reroll/") +@auth_required +def reroll_oauth_tokens(aid, v): + + aid = aid + + a = g.db.query(OauthApp).filter_by(id=aid).first() + + if a.author_id != v.id: abort(403) + + a.client_id = secrets.token_urlsafe(64)[:64] + g.db.add(a) + + return {"message": "Client ID Rerolled", "id": a.client_id} \ No newline at end of file