log ppl into deux automatically

master
Aevann1 2022-07-13 20:14:07 +02:00
parent 5fb6bd86f9
commit 86f7e627ea
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,14 @@ def get_logged_in_user():
v.client = client v.client = client
else: else:
lo_user = session.get("lo_user") lo_user = session.get("lo_user")
if SITE == 'deuxrama.net' and not lo_user and not session.get("checked"):
session["checked"] = True
id = requests.get('https://rdrama.net/check_loggedin').json()['id']
if id and id <= 12353:
session["lo_user"] = id
lo_user = session["lo_user"]
if lo_user: if lo_user:
id = int(lo_user) id = int(lo_user)
v = get_account(id) v = get_account(id)

View File

@ -562,3 +562,9 @@ def reset_2fa():
return render_template("message_success.html", return render_template("message_success.html",
title="Two-factor authentication removed.", title="Two-factor authentication removed.",
message="Login normally to access your account.") message="Login normally to access your account.")
@app.get("/check_loggedin")
@auth_desired
def check_loggedin(v):
return {"id": v.id if v else None}