Projet

Général

Profil

0005-to-fixup-fix-callback-template-when-test-mode-is-not.patch

Benjamin Dauvergne, 25 mai 2021 11:00

Télécharger (1,91 ko)

Voir les différences:

Subject: [PATCH 5/5] to fixup: fix callback template when test mode is not
 used

 .../templates/franceconnect/callback.html             | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
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
-