templates/security/auth_confirmation.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Admin Digidom{% endblock %}
  3. {% block body %}
  4.     <div class="row vh-100">
  5.         <div class="col-md-3 d-flex justify-content-center align-items-center align-items-md-start pt-md-4"
  6.              style="background: #353535; box-shadow: 5px 0 30px 0px #353535; border-right: 1px solid #aaa;">
  7.             <img src="{{ asset('img/logo.png') }}" style="width: 50%;"/>
  8.         </div>
  9.         <div class="col-12 col-md-6 d-flex align-items-center px-5">
  10.             <form method="post" class="mx-auto col-12 col-md-8">
  11.                 {% if error %}
  12.                     <div class="alert alert-danger">{{ error }}</div>
  13.                 {% endif %}
  14.                 <h1 class="h3 mb-3 font-weight-normal">Confirmation authentification</h1>
  15.                 <label for="inputConfirmation" class="pt-3">Veuillez entrer le code envoyé dans votre email</label>
  16.                 <div class="input-group">
  17.                     <input type="text" maxlength="6" name="code_confirmation" id="inputConfirmation"
  18.                            class="form-control"
  19.                            required autofocus>
  20.                     <div class="input-group-append">
  21.                         <a class="btn btn-primary" id="resend_code" style="color:white;" data-email="{{ userEmail }}">
  22.                             Renvoyer le code
  23.                         </a>
  24.                     </div>
  25.                 </div>
  26.                 <input type="hidden" name="_csrf_token"
  27.                        value="{{ csrf_token('authenticate') }}"
  28.                 >
  29.                 <br>
  30.                 <button class="btn btn-primary mt-3" type="submit">
  31.                     Valider
  32.                 </button>
  33.             </form>
  34.         </div>
  35.         <div class="col-md-3"></div>
  36.     </div>
  37.     <script>
  38.         $('#resend_code').on('click', function () {
  39.             var content = $(this);
  40.             $.ajax({
  41.                 method: "POST",
  42.                 url: "/v1/send-back-code",
  43.                 contentType: 'application/json',
  44.                 data: JSON.stringify(
  45.                     {
  46.                         "email": content.data('email')
  47.                     }
  48.                 ),
  49.                 dataType: "json"
  50.             })
  51.             .done(function (msg) {
  52.                 if(msg == 'success') {
  53.                     $("#resend_code").prepend('<span class="fa fa-check"></span>').addClass('btn-success').prop('disabled', true);
  54.                 } else {
  55.                     $("#resend_code").prepend('<span class="fa fa-times"></span>').addClass('btn-danger').prop('disabled', true);
  56.                 }
  57.             });
  58.         });
  59.     </script>
  60. {% endblock %}