confirm-auth-token.blade.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @extends('layouts.login')
  2. @section('content')
  3. <div id="confirmAuthTokenComponent" class="blue-card p-4" v-cloak>
  4. <form action="{{route('process-confirm-auth-token')}}" method="post">
  5. <div class="text-center d-flex align-items-center my-3">
  6. <img src="/img/icon.svg" alt="Logo" height="35">
  7. <h5 class="font-weight-bold ml-2 mb-0">Confirm Token</h5>
  8. </div>
  9. @csrf
  10. @if(session('message'))
  11. <div class="alert alert-info">{{session('message')}}</div>
  12. @endif
  13. <div class="form-group">
  14. <label>
  15. <strong>
  16. Please enter the confirmation token sent to {{ $maskedCellNumber }}.
  17. </strong>
  18. </label>
  19. <input class="form-control" name="confirmation_token" autocomplete="off" autofocus value="{{old('confirmation_token')}}">
  20. </div>
  21. <div class="row">
  22. <div class="col-12 text-center">
  23. <input type="submit" name="sendToken" value="Confirm Token" class="btn btn-orange btn-sm w-100 py-2">
  24. </div>
  25. </div>
  26. </form>
  27. <div class="text-center mt-3">
  28. <div class="d-flex align-items-center flex-wrap justify-content-center">
  29. <a href="#" class="text-underline" resend-token>
  30. <u v-if="!loading">Resend token</u>
  31. <u v-else><i class="fas fa-circle-notch fa-spin"></i> Resending...</u>
  32. </a>
  33. <span class="mx-2 font-weight-bold">OR</span>
  34. <a href="{{ route('login') }}"><u>Change phone number</u></a>
  35. </div>
  36. </div>
  37. <div v-if="response" class="text-center">
  38. <small v-if="!response.success" class="text-danger"><i class="fas fa-exclamation-triangle"></i> @{{ response.message }}</small>
  39. <small v-else class="text-success"><i class="fas fa-check-circle"></i> Confirmation code has been resent!</small>
  40. </div>
  41. <p><small class="text-center d-block text-muted my-3">If you have any questions at all, please contact your Dedicated HR Representative at the phone number or email displayed inside this portal.</small></p>
  42. </div>
  43. <script>
  44. var confirmAuthTokenComponent = new Vue({
  45. el: '#confirmAuthTokenComponent',
  46. data: {
  47. loading: false,
  48. response: null
  49. },
  50. delimiters: ['@[[', ']]'],
  51. methods: {
  52. initResendConfirmationToken: function() {
  53. var self = this;
  54. $('[resend-token]').click(function(evt) {
  55. evt.preventDefault();
  56. if (self.loading) return;
  57. self.loading = true;
  58. $.post("{{ route('resend-sms-auth-token') }}", {}, function(response) {
  59. self.loading = false;
  60. self.response = response;
  61. }, 'json');
  62. });
  63. },
  64. init: function() {
  65. this.initResendConfirmationToken();
  66. },
  67. },
  68. mounted: function() {
  69. this.init();
  70. }
  71. });
  72. </script>
  73. @endsection