Skip to content

Commit

Permalink
🚧 fix infinite redirect due to sessionrefresh
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Jun 24, 2024
1 parent 55ac66b commit eaff13f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mozilla_django_oidc_db/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def store_config(request: HttpRequest) -> None:

state = states[state_key]
try:
config = apps.get_model(state.get("config_class", ""))
config = apps.get_model(request.session.get("OIDC_CONFIG_CLASS", ""))
except (LookupError, ValueError) as exc:
raise BadRequest("Could not look up the referenced config.") from exc

Expand Down
2 changes: 2 additions & 0 deletions mozilla_django_oidc_db/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ def get(
state = request.session["oidc_states"][state_key]
state["config_class"] = f"{options.app_label}.{options.object_name}"

request.session["OIDC_CONFIG_CLASS"] = f"{options.app_label}.{options.object_name}"

return response

@staticmethod
Expand Down

0 comments on commit eaff13f

Please sign in to comment.