Skip to content

Commit

Permalink
🐛 [#3613] Check if user needs to be redirected to login if authentica…
Browse files Browse the repository at this point in the history
…tion is not required
  • Loading branch information
SilviaAmAm committed Dec 1, 2023
1 parent 31e8662 commit da6867a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/openforms/submissions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,17 @@ def get_redirect_url(

# TODO: remove code duplication

# No login required, skip authentication
if not submission.form.login_required:
# No login required. If the user did NOT log in when initially starting the submission (that they are now
# resuming) skip authentication.
if not submission.form.login_required and not submission.is_authenticated:
submission = self.custom_submission_modifications(submission)
add_submmission_to_session(submission, self.request.session)
submission_resumed.send(
sender=self.__class__, instance=submission, request=self.request
)
return self.get_form_resume_url(submission)

# Login IS required. Check if the user has already logged in.
# Check if the user has already logged in.
# This is done by checking if the authentication details are in the session and
# if they match those in the saved submission.
if FORM_AUTH_SESSION_KEY in self.request.session:
Expand Down

0 comments on commit da6867a

Please sign in to comment.