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:
parent
b46ada9f72
commit
9f042c1aeb
4 changed files with 19 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue