plain.auth 0.20.3__py3-none-any.whl → 0.20.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plain/auth/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # plain-auth changelog
2
2
 
3
+ ## [0.20.5](https://github.com/dropseed/plain/releases/plain-auth@0.20.5) (2025-10-20)
4
+
5
+ ### What's changed
6
+
7
+ - Updated `pyproject.toml` to use standard `[dependency-groups]` format instead of uv-specific `[tool.uv]` section for development dependencies ([1b43a3a](https://github.com/dropseed/plain/commit/1b43a3a272))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required
12
+
13
+ ## [0.20.4](https://github.com/dropseed/plain/releases/plain-auth@0.20.4) (2025-10-16)
14
+
15
+ ### What's changed
16
+
17
+ - The `get_current_user()` template function now catches `SessionNotAvailable` exceptions and returns `None`, preventing errors during error page rendering before middleware runs ([fb889fa](https://github.com/dropseed/plain/commit/fb889fa0e9))
18
+
19
+ ### Upgrade instructions
20
+
21
+ - No changes required
22
+
3
23
  ## [0.20.3](https://github.com/dropseed/plain/releases/plain-auth@0.20.3) (2025-10-07)
4
24
 
5
25
  ### What's changed
plain/auth/templates.py CHANGED
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any
4
4
 
5
5
  from jinja2 import pass_context
6
6
 
7
+ from plain.sessions.exceptions import SessionNotAvailable
7
8
  from plain.templates import register_template_global
8
9
 
9
10
  from .requests import get_request_user
@@ -18,4 +19,8 @@ def get_current_user(context: Context) -> Any | None:
18
19
  """Get the authenticated user for the current request."""
19
20
  request = context.get("request")
20
21
  assert request is not None, "No request in template context"
21
- return get_request_user(request)
22
+ try:
23
+ return get_request_user(request)
24
+ except SessionNotAvailable:
25
+ # Session not available (e.g., during error page rendering before middleware runs)
26
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.auth
3
- Version: 0.20.3
3
+ Version: 0.20.5
4
4
  Summary: Add users to your app and decide what they can access.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-File: LICENSE
@@ -1,14 +1,14 @@
1
- plain/auth/CHANGELOG.md,sha256=C0gBGYr2hupTa7mjegRf-sEJahDLuBQZOmSC50jztUY,5304
1
+ plain/auth/CHANGELOG.md,sha256=655wNgY-0Jf5J0xrgsmJNh5D5zHzS5elofquaBdvSg4,6073
2
2
  plain/auth/README.md,sha256=I1SeOyrBnF0GAjD7T0k5OlZ2bSHz9---nElinaobewc,4030
3
3
  plain/auth/__init__.py,sha256=CrOsS74CPGN1nPTTfie13mPgdyVLRyZ1YwDPIA77uaA,179
4
4
  plain/auth/default_settings.py,sha256=65VzDn3j61OMn78Lg6Zuds4A8QKzJJ_0G9KoFqAOIRo,466
5
5
  plain/auth/requests.py,sha256=jUlMTOWFt0qfDF_uVkOqaP9rZiCLrAofsmirCwyRGEE,880
6
6
  plain/auth/sessions.py,sha256=xDp1EiB0cV5w3L5XioqO8vs77wnF8cvreExms3-e744,6015
7
- plain/auth/templates.py,sha256=bOMPfLrf8SSxOSWrKTkqKGaK3aNBTLxe62HJulghutU,556
7
+ plain/auth/templates.py,sha256=CVtuIdBgOgYB2o61zpOPJb6nMx_gU61i_3PDQx8FjVs,770
8
8
  plain/auth/test.py,sha256=SHawhwarJEMVfaLkjpiuFVSWZoGIMwhzXreU_T1zvCE,1599
9
9
  plain/auth/utils.py,sha256=9kKWh1QqxA8Esct-jBvTCdjBYOHpO_Tg1YeV9WxYmxg,1362
10
10
  plain/auth/views.py,sha256=vWLMeykTrA5LtA179uE7w-BY9Kv25r1VScLHooDvZUA,4792
11
- plain_auth-0.20.3.dist-info/METADATA,sha256=OUbZL8QidYcsulh1gkbQYXtghQtooqusk-n9rZkc7yg,4390
12
- plain_auth-0.20.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
- plain_auth-0.20.3.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
14
- plain_auth-0.20.3.dist-info/RECORD,,
11
+ plain_auth-0.20.5.dist-info/METADATA,sha256=iNaLUVf_tcT_V6KBVFyPTdDf7RxXFZmwCA1hYUpE4uE,4390
12
+ plain_auth-0.20.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
+ plain_auth-0.20.5.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
14
+ plain_auth-0.20.5.dist-info/RECORD,,