rDrama/files/routes
TLSM 9e2ceb28b0 Fix four routes with auth_desired misimplemented.
PR #374 removed `@auth_required` from a number of routes and changed
those which used their `v` parameters to `v=None` and removed the `v`
parameter from those which didn't internally use it. 1841134b47

PR #392 re-added `@auth_desired` to those routes to ensure the
templates rendered with awareness of the current logged-in user
(matters for search, header bar, etc). 9f042c1aeb

However, 500 errors occurred on /random_post, /random_user, /id/<uid>,
and /u/<username>. Those were the four which had their `v` parameter
removed entirely. This has been re-added, which fixes the bug.

The way to understand auth_required vs auth_desired is that they are
nearly identical, with the sole difference than auth_required
checks if v is None and aborts with 401 if so. This means that
auth_desired routes must handle the v=None case. They are the same in
that they always try to give a `v` kwarg to the decorated function,
which was the root cause of those four routes erroring.

Recommended style: the vast majority of routes which return a rendered
template should be auth_desired, because the top-level templates often
draw extensively from `v` state even when the route handler does not.
When a route is either auth_desired or auth_required, it should have a
`v` parameter, which we typically give as the first positional
parameter.
2022-11-06 03:11:59 -06:00
..
__init__.py Add trailing LF to text files 2022-05-10 21:05:51 -04:00
admin.py caching: fix CSRF 2022-11-02 23:51:33 -05:00
awards.py Remove coins from popovers, disable coin routes. 2022-09-05 23:44:18 -05:00
chat.py Remove some gimmicky r/drama features. 2022-05-21 21:43:00 -05:00
comments.py Fix: Bug introduced with comment security fix 2022-11-02 01:38:43 -05:00
discord.py Add trailing LF to text files 2022-05-10 21:05:51 -04:00
errors.py Only show /leaderboard link in settings2 menu to admins, also a more polite 403 message, also more readable HTML 2022-08-21 01:44:56 +01:00
feeds.py Change default RSS sort to 'new'. 2022-09-12 12:16:54 -05:00
front.py Fix four routes with auth_desired misimplemented. 2022-11-06 03:11:59 -06:00
giphy.py Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
login.py Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
oauth.py Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
posts.py Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
reporting.py Switch over comment reporting to use the new system 2022-07-09 06:33:41 -05:00
search.py Fix four routes with auth_desired misimplemented. 2022-11-06 03:11:59 -06:00
settings.py Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
static.py Fix four routes with auth_desired misimplemented. 2022-11-06 03:11:59 -06:00
subs.py Add trailing LF to text files 2022-05-10 21:05:51 -04:00
users.py Fix four routes with auth_desired misimplemented. 2022-11-06 03:11:59 -06:00
votes.py Fix #241: admin action rate limits too low. 2022-09-06 12:35:22 -05:00