0005-to-fixup-fix-callback-template-when-test-mode-is-not.patch
passerelle/apps/franceconnect/templates/franceconnect/callback.html | ||
---|---|---|
2 | 2 |
<head> |
3 | 3 |
</head> |
4 | 4 |
<body> |
5 |
{% if test %}<button id="continue">Continue</button> |
|
6 | 5 |
{{ data|json_script:"data" }} |
6 |
{% if test %}<button id="continue">Continue</button> |
|
7 | 7 |
<p>redirect_uri: <pre>{{ redirect_uri|pprint }}</pre></p> |
8 | 8 |
<p>correlation_id: <pre>{{ franceconnect.correlation_id }}</pre></p> |
9 | 9 |
{% if error %} |
... | ... | |
26 | 26 |
<script> |
27 | 27 |
(function () { |
28 | 28 |
const data = JSON.parse(document.getElementById('data').textContent); |
29 |
const continue_button = document.getElementById('continue'); |
|
30 | 29 |
const post_message = function () { |
31 | 30 |
window.opener.postMessage(data, "{{ origin }}"); |
32 |
} |
|
33 |
{% if test %}continue_button.addEventListener('click', function () { post_message(); }); |
|
34 |
{% else %}post_message(){% endif %} |
|
31 |
}{% if test %} |
|
32 |
const continue_button = document.getElementById('continue'); |
|
33 |
continue_button.addEventListener('click', function () { post_message(); }); |
|
34 |
{% else %} |
|
35 |
post_message(){% endif %} |
|
35 | 36 |
})(); |
36 | 37 |
</script> |
37 | 38 |
</body> |
38 |
- |