Commit graph

14 commits

Author SHA1 Message Date
Calvin Montgomery
62417f7fb8
Add eslint (#741) 2018-04-07 15:30:30 -07:00
Calvin Montgomery
99076412b6 Fix unhandled rejection 2017-08-14 20:31:45 -07:00
Calvin Montgomery
6043647cb7 Skip full user auth for most page renders
Previously, the user's session cookie was being checked against the
database for all non-static requests.  However, this is not really
needed and wastes resources (and is slow).

For most page views (e.g. index, channel page), just parsing the value
of the cookie is sufficient:

  * The cookies are already HMAC signed, so tampering with them ought to
    be for all reasonable purposes, impossible.
  * Assuming the worst case, all a nefarious user could manage to do is
    change the text of the "Welcome, {user}" and cause a (non-functional)
    ACP link to appear clientside, both of which are already possible by
    using the Inspect Element tool.

For authenticated pages (currently, the ACP, and anything under
/account/), the full database check is still performed (for now).
2017-08-01 21:40:26 -07:00
Calvin Montgomery
76e0d1b7ec Use proxy-addr for parsing x-forwarded-for
Closes #683 by providing functionality to trust proxies other than
localhost.
2017-06-27 23:37:18 -07:00
Calvin Montgomery
de309d675e Remove redundant signing logic from IP session cookie 2017-05-01 21:51:11 -07:00
calzoneman
17aad006f7 Fix startup issue 2016-08-10 22:37:33 -07:00
calzoneman
0327b3de2e Modifications for ip session cookie 2016-08-10 22:10:02 -07:00
calzoneman
6245dc84da Minor bug fix 2016-08-08 23:04:34 -07:00
calzoneman
016b125f49 Initial IP session cookie implementation 2016-08-08 23:03:16 -07:00
calzoneman
bfe76dae0e Check X-Forwarded-For on sockets (resolves #528) 2015-12-12 16:59:58 -08:00
calzoneman
27af66075e Centralize x-forwarded-proto handling; fixes #542 2015-12-12 16:26:14 -08:00
calzoneman
47ef670f34 Fix typo 2015-11-02 21:10:52 -08:00
calzoneman
6505aa2f5e More refactoring 2015-11-01 17:42:20 -08:00
calzoneman
c2726898e5 Move x-forwarded-for middleware 2015-10-27 23:54:32 -07:00