Stay logged in on certain routes (#392)

This commit adds the @auth_desired decorator to
routes that previous had the @auth_required decorator,
but had it removed in #374. This should cause
the user to remain logged in on these routes.
This commit is contained in:
electricwhisk 2022-10-27 23:16:22 -04:00 committed by GitHub
parent b46ada9f72
commit 9f042c1aeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View file

@ -467,6 +467,7 @@ def changeloglist(v=None, sort="new", page=1, t="all", site=None):
@app.get("/random_post")
@auth_desired
def random_post():
p = g.db.query(Submission.id).filter(Submission.deleted_utc == 0, Submission.is_banned == False, Submission.private == False).order_by(func.random()).first()
@ -478,6 +479,7 @@ def random_post():
@app.get("/random_user")
@auth_desired
def random_user():
u = g.db.query(User.username).order_by(func.random()).first()