confirm-auth-token.blade.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 my-3">
  6. <img src="/img/logo.svg" alt="Logo" height="35">
  7. </div>
  8. @csrf
  9. @if(session('message'))
  10. <div class="alert alert-info">{{session('message')}}</div>
  11. @endif
  12. <div class="form-group">
  13. <label>
  14. <strong>
  15. Please enter the confirmation token.
  16. </strong>
  17. </label>
  18. <input class="form-control phone" name="confirmation_token" autofocus value="{{old('confirmation_token')}}">
  19. </div>
  20. <div class="row">
  21. <div class="col-12 text-center">
  22. <input type="submit" name="sendToken" value="Confirm Token" class="btn btn-orange btn-sm w-100 py-2">
  23. </div>
  24. </div>
  25. </form>
  26. <div class="text-center mt-3">
  27. <a href="#" class="text-underline" resend-token>
  28. <u v-if="!loading">Resend confirmation token</u>
  29. <u v-else><i class="fas fa-circle-notch fa-spin"></i> Resending...</u>
  30. </a>
  31. </div>
  32. <div v-if="response" class="text-center">
  33. <small v-if="!response.success" class="text-danger"><i class="fas fa-exclamation-triangle"></i> @{{ response.message }}</small>
  34. <small v-else class="text-success"><i class="fas fa-check-circle"></i> Confirmation code has been resent!</small>
  35. </div>
  36. <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>
  37. </div>
  38. <script>
  39. var confirmAuthTokenComponent = new Vue({
  40. el: '#confirmAuthTokenComponent',
  41. data: {
  42. loading: false,
  43. response: null
  44. },
  45. delimiters:['@[[', ']]'],
  46. methods: {
  47. initResendConfirmationToken: function() {
  48. var self = this;
  49. $('[resend-token]').click(function(evt) {
  50. evt.preventDefault();
  51. if (self.loading) return;
  52. self.loading = true;
  53. $.post("{{ route('resend-sms-auth-token') }}", {}, function(response) {
  54. self.loading = false;
  55. self.response = response;
  56. }, 'json');
  57. });
  58. },
  59. init: function() {
  60. this.initResendConfirmationToken();
  61. },
  62. },
  63. mounted: function() {
  64. this.init();
  65. }
  66. });
  67. </script>
  68. @endsection