two-factor-authentication-form.blade.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <x-jet-action-section>
  2. <x-slot name="title">
  3. {{ __('Two Factor Authentication') }}
  4. </x-slot>
  5. <x-slot name="description">
  6. {{ __('Add additional security to your account using two factor authentication.') }}
  7. </x-slot>
  8. <x-slot name="content">
  9. <h3 class="text-lg font-medium text-gray-900">
  10. @if ($this->enabled)
  11. {{ __('You have enabled two factor authentication.') }}
  12. @else
  13. {{ __('You have not enabled two factor authentication.') }}
  14. @endif
  15. </h3>
  16. <div class="mt-3 max-w-xl text-sm text-gray-600">
  17. <p>
  18. {{ __('When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\'s Google Authenticator application.') }}
  19. </p>
  20. </div>
  21. @if ($this->enabled)
  22. @if ($showingQrCode)
  23. <div class="mt-4 max-w-xl text-sm text-gray-600">
  24. <p class="font-semibold">
  25. {{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }}
  26. </p>
  27. </div>
  28. <div class="mt-4 dark:p-4 dark:w-56 dark:bg-white">
  29. {!! $this->user->twoFactorQrCodeSvg() !!}
  30. </div>
  31. @endif
  32. @if ($showingRecoveryCodes)
  33. <div class="mt-4 max-w-xl text-sm text-gray-600">
  34. <p class="font-semibold">
  35. {{ __('Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.') }}
  36. </p>
  37. </div>
  38. <div class="grid gap-1 max-w-xl mt-4 px-4 py-4 font-mono text-sm bg-gray-100 rounded-lg">
  39. @foreach (json_decode(decrypt($this->user->two_factor_recovery_codes), true) as $code)
  40. <div>{{ $code }}</div>
  41. @endforeach
  42. </div>
  43. @endif
  44. @endif
  45. <div class="mt-5">
  46. @if (! $this->enabled)
  47. <x-jet-confirms-password wire:then="enableTwoFactorAuthentication">
  48. <x-jet-button type="button" wire:loading.attr="disabled">
  49. {{ __('Enable') }}
  50. </x-jet-button>
  51. </x-jet-confirms-password>
  52. @else
  53. @if ($showingRecoveryCodes)
  54. <x-jet-confirms-password wire:then="regenerateRecoveryCodes">
  55. <x-jet-secondary-button class="mr-3">
  56. {{ __('Regenerate Recovery Codes') }}
  57. </x-jet-secondary-button>
  58. </x-jet-confirms-password>
  59. @else
  60. <x-jet-confirms-password wire:then="showRecoveryCodes">
  61. <x-jet-secondary-button class="mr-3">
  62. {{ __('Show Recovery Codes') }}
  63. </x-jet-secondary-button>
  64. </x-jet-confirms-password>
  65. @endif
  66. <x-jet-confirms-password wire:then="disableTwoFactorAuthentication">
  67. <x-jet-danger-button wire:loading.attr="disabled">
  68. {{ __('Disable') }}
  69. </x-jet-danger-button>
  70. </x-jet-confirms-password>
  71. @endif
  72. </div>
  73. </x-slot>
  74. </x-jet-action-section>