logout-other-browser-sessions-form.blade.php 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <x-jet-action-section>
  2. <x-slot name="title">
  3. {{ __('Browser Sessions') }}
  4. </x-slot>
  5. <x-slot name="description">
  6. {{ __('Manage and log out your active sessions on other browsers and devices.') }}
  7. </x-slot>
  8. <x-slot name="content">
  9. <div class="max-w-xl text-sm text-gray-600">
  10. {{ __('If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.') }}
  11. </div>
  12. @if (count($this->sessions) > 0)
  13. <div class="mt-5 space-y-6">
  14. <!-- Other Browser Sessions -->
  15. @foreach ($this->sessions as $session)
  16. <div class="flex items-center">
  17. <div>
  18. @if ($session->agent->isDesktop())
  19. <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor" class="w-8 h-8 text-gray-500">
  20. <path d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>
  21. </svg>
  22. @else
  23. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" class="w-8 h-8 text-gray-500">
  24. <path d="M0 0h24v24H0z" stroke="none"></path><rect x="7" y="4" width="10" height="16" rx="1"></rect><path d="M11 5h2M12 17v.01"></path>
  25. </svg>
  26. @endif
  27. </div>
  28. <div class="ml-3">
  29. <div class="text-sm text-gray-600">
  30. {{ $session->agent->platform() }} - {{ $session->agent->browser() }}
  31. </div>
  32. <div>
  33. <div class="text-xs text-gray-500">
  34. {{ $session->ip_address }},
  35. @if ($session->is_current_device)
  36. <span class="text-green-500 font-semibold">{{ __('This device') }}</span>
  37. @else
  38. {{ __('Last active') }} {{ $session->last_active }}
  39. @endif
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. @endforeach
  45. </div>
  46. @endif
  47. <div class="flex items-center mt-5">
  48. <x-jet-button wire:click="confirmLogout" wire:loading.attr="disabled">
  49. {{ __('Log Out Other Browser Sessions') }}
  50. </x-jet-button>
  51. <x-jet-action-message class="ml-3" on="loggedOut">
  52. {{ __('Done.') }}
  53. </x-jet-action-message>
  54. </div>
  55. <!-- Log Out Other Devices Confirmation Modal -->
  56. <x-jet-dialog-modal wire:model="confirmingLogout">
  57. <x-slot name="title">
  58. {{ __('Log Out Other Browser Sessions') }}
  59. </x-slot>
  60. <x-slot name="content">
  61. {{ __('Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.') }}
  62. <div class="mt-4" x-data="{}" x-on:confirming-logout-other-browser-sessions.window="setTimeout(() => $refs.password.focus(), 250)">
  63. <x-jet-input type="password" class="mt-1 block w-3/4"
  64. placeholder="{{ __('Password') }}"
  65. x-ref="password"
  66. wire:model.defer="password"
  67. wire:keydown.enter="logoutOtherBrowserSessions" />
  68. <x-jet-input-error for="password" class="mt-2" />
  69. </div>
  70. </x-slot>
  71. <x-slot name="footer">
  72. <x-jet-secondary-button wire:click="$toggle('confirmingLogout')" wire:loading.attr="disabled">
  73. {{ __('Cancel') }}
  74. </x-jet-secondary-button>
  75. <x-jet-button class="ml-2"
  76. wire:click="logoutOtherBrowserSessions"
  77. wire:loading.attr="disabled">
  78. {{ __('Log Out Other Browser Sessions') }}
  79. </x-jet-button>
  80. </x-slot>
  81. </x-jet-dialog-modal>
  82. </x-slot>
  83. </x-jet-action-section>