pyobs-auth 2.0.0.dev2__py3-none-any.whl → 2.0.0.dev3__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.
pyobs_auth/views.py CHANGED
@@ -29,7 +29,9 @@ class LoginView(View):
29
29
 
30
30
  request.session[SESSION_STATE_KEY] = authorization.state
31
31
  request.session[SESSION_CODE_VERIFIER_KEY] = authorization.code_verifier
32
- request.session[SESSION_NEXT_KEY] = request.GET.get("next", "/")
32
+ # `or "/"` (not just a dict default) because `?next=` with an empty value is a present-but-
33
+ # falsy key - `.get("next", "/")` alone would return "" instead of falling back to "/".
34
+ request.session[SESSION_NEXT_KEY] = request.GET.get("next") or "/"
33
35
 
34
36
  return HttpResponseRedirect(authorization.url)
35
37
 
@@ -44,7 +46,7 @@ class CallbackView(View):
44
46
  state = request.GET.get("state")
45
47
  expected_state = request.session.pop(SESSION_STATE_KEY, None)
46
48
  code_verifier = request.session.pop(SESSION_CODE_VERIFIER_KEY, None)
47
- next_url = request.session.pop(SESSION_NEXT_KEY, "/")
49
+ next_url = request.session.pop(SESSION_NEXT_KEY, "/") or "/"
48
50
 
49
51
  if not code or not state or not code_verifier or state != expected_state:
50
52
  return HttpResponseBadRequest("Invalid or expired login state")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyobs-auth
3
- Version: 2.0.0.dev2
3
+ Version: 2.0.0.dev3
4
4
  Summary: Shared Keycloak/OIDC authentication client for pyobs web services
5
5
  Author-email: Tim-Oliver Husser <thusser@uni-goettingen.de>
6
6
  License-Expression: MIT
@@ -7,8 +7,8 @@ pyobs_auth/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  pyobs_auth/settings.py,sha256=MhHnhsdrlhpLzC7GhVjQEaMhxKz6aDeUFju1J5ieJjM,3051
8
8
  pyobs_auth/urls.py,sha256=6fMyNdX7jDyl-wVUXAyUG4HjJngrfR_rk9i2PKt0lGA,236
9
9
  pyobs_auth/validation.py,sha256=cOuG6kl4_O03BWACJZfhsPLuEYQvj36FxBYk-adneyI,2673
10
- pyobs_auth/views.py,sha256=euZ433EcO0mrBoTCmCbRHCrKmbyR0bV1HvIVa6V8lxA,3123
11
- pyobs_auth-2.0.0.dev2.dist-info/METADATA,sha256=yyxN-cJzX7ZddMMHgL5TKp2phwQtWgPupNpIzUAWhSw,410
12
- pyobs_auth-2.0.0.dev2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
13
- pyobs_auth-2.0.0.dev2.dist-info/licenses/LICENSE,sha256=Gi2yBbEZraESTIWbTnc4elzshQaXpW4QBs9FBotLG7A,1099
14
- pyobs_auth-2.0.0.dev2.dist-info/RECORD,,
10
+ pyobs_auth/views.py,sha256=k__LAc3CJkt863ZEm_hMTGMHG1NQpdlQx6s5brJjUrs,3328
11
+ pyobs_auth-2.0.0.dev3.dist-info/METADATA,sha256=CETttacanTBjl9kDqQwtohacIESXdENSNMB8FlxLX_Q,410
12
+ pyobs_auth-2.0.0.dev3.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
13
+ pyobs_auth-2.0.0.dev3.dist-info/licenses/LICENSE,sha256=Gi2yBbEZraESTIWbTnc4elzshQaXpW4QBs9FBotLG7A,1099
14
+ pyobs_auth-2.0.0.dev3.dist-info/RECORD,,