-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use form POST request when clearing session data
This builds on the work done in #588. Previously the ‘clear data’ feature used two GET requests – one to display the confirmation screen, and a second to actually clear the session data. This is not ideal because GET requests are meant to be nullipotent (to have no side effects), and links from the docs part of the kit were still pointing to the old URL, which bypassed the confirmation screen. This adds a form to the confirmation screen which POSTs to itself (/prototype-admin/clear-data), and changes the old data-clearing route to match.
- Loading branch information
Showing
5 changed files
with
52 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "layout.html" %} | ||
|
||
{% block pageTitle %} | ||
Clear data | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h1 class="govuk-heading-m"> | ||
Data cleared | ||
</h1> | ||
|
||
<p> | ||
The session data has been cleared. | ||
</p> | ||
|
||
<p> | ||
<a href="/"> | ||
Prototype home page | ||
</a> | ||
</p> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
|
||
{% extends "layout.html" %} | ||
|
||
{% block pageTitle %} | ||
Clear data | ||
Clear data? | GOV.UK Prototype Kit | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% block beforeContent %} | ||
{{ govukBackLink({ | ||
"text": "Back", | ||
"href": "javascript: window.history.go(-1)" | ||
}) | ||
}} | ||
{% endblock %} | ||
|
||
<h1 class="govuk-heading-m"> | ||
Data cleared | ||
</h1> | ||
{% block content %} | ||
|
||
<p> | ||
The session data has been cleared. | ||
</p> | ||
<form method="post"> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl"> | ||
Clear data? | ||
</h1> | ||
{{ govukWarningText({ | ||
text: "This will clear all of the data entered in this session", | ||
iconFallbackText: "Warning" | ||
}) }} | ||
|
||
<p> | ||
<a href="/"> | ||
Prototype home page | ||
</a> | ||
</p> | ||
{{ govukButton({ | ||
text: "Clear the data" | ||
}) }} | ||
</div> | ||
</div> | ||
</form> | ||
|
||
{% endblock %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters