-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosign improvements - batch 1 #4808
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4808 +/- ##
==========================================
+ Coverage 96.55% 96.56% +0.01%
==========================================
Files 748 749 +1
Lines 25423 25499 +76
Branches 3362 3375 +13
==========================================
+ Hits 24548 24624 +76
Misses 610 610
Partials 265 265 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
6ffbad3
to
34608cc
Compare
Users who have the link in the email are directly taken to the right place to start the cosign process. This obsoletes the entrypoint at the form start, and by not returning any login options for cosign, we prevent this block from appearing in the frontend. Detection of a link is used or not is done by checking for the presence of the 'form_url' context variable in the request email template.
If URLs in emails are enabled for the cosign request email, create a more useful URL to the form by giving a 'init-cosign' instruction, passing along the submission reference/code so that we can auto-populate that information and cut out intermediate screens for the end-user. If URLs are not enabled, we stick to the old behaviour.
Now also emit whether links are enabled or not, and let the frontend code decide based on this information whether options should be rendered or not. We need access to the options in certain views on the frontend, and we cannot pass a query param to opt in/out from the frontend as the API call to retrieve the form is done *after* the param processing.
If the code querystring parameter is provided, perform the form validation in the GET request rather than requiring the user to fill out the form, and automatically redirect back to the frontend to do the cosigning. There is a minor risk for CSRF here, *if* the attacker is able to guess the submission reference + form combination and the victim has an active, authenticated session. Note that the session idle time is capped at 15 minutes, so the risk is considered not problematic.
34608cc
to
ce0bd5a
Compare
Added title and confirmation page configuration fields to control what is displayed on the confirmation page in the SDK. The runtime code will select the appropriate template depending on whether cosigning is required for the submission or not (it may be optional through form logic!)
Depending on whether cosign is enabled or not, different confirmation page templates are rendered and returned via the status API endpoint for the frontend to display.
e705a98
to
740f52b
Compare
Added a custom templatetag that can optionally be included in the confirmation page content/template to dislay a link/button that allows users to start the cosign process from the confirmation page. This is the same link that is included in emails, when the form_url variable is used in there. The appearance is fixed to primary button, the button text can be controlled from the template.
Added some introspection in the migration to properly evaluate the translated default values for the newly added configuration model fields.
740f52b
to
7078014
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me.
The only thing I don't get is the "Cosign now" button that is shown when the user completes the form. I saw that the task has this as a requirement but why do we have it there since the cosigning step has to do with another user?
That's for the cases where the cosigner is physically present the original submitter - this makes it possible to finish the full submission more quickly. |
Closes #4320 (partly)
The frontend aspect is handled in open-formulieren/open-forms-sdk#729
Email/PDF contents will be done in a different PR.
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Commit hygiene