@extends('client.layouts.app') @section('title', __('client.security.title')) @section('content')
{{ __('client.security.two_factor') }}

{{ __('client.security.2fa_desc') }}

@if($twoFactorEnabled ?? false)
✓ {{ __('client.security.2fa_enabled') }}
@csrf
{{-- The backup codes are flashed here once, right after 2FA is switched on (AuthController::enable2fa). Nothing showed them, so a customer who lost their phone held codes they had never seen. --}} @if(is_array(session('backup_codes')) && session('backup_codes'))
{{ __('client.security.backup_codes_title') }}

{{ __('client.security.backup_codes_hint') }}

    @foreach(session('backup_codes') as $backupCode)
  • {{ $backupCode }}
  • @endforeach
@endif @else
{{ __('client.security.2fa_not_enabled') }} {{ __('client.auth.enable_2fa_btn') }}
@endif
@if($phoneVerifyAvailable ?? false)
{{ __('client.phone_verify.title') }}
@if($client?->phone_verified_at)
✓ {{ __('client.phone_verify.verified_label') }} ({{ $client->full_phone }})
@elseif(! $client?->full_phone)

{{ __('client.phone_verify.no_phone') }}

@elseif(session('phone_code_sent'))

{{ __('client.phone_verify.enter_code_hint') }}

@csrf
@error('code')

{{ $message }}

@enderror @else
{{ __('client.phone_verify.unverified_label') }} ({{ $client->full_phone }})
@csrf
@error('phone')

{{ $message }}

@enderror @endif
@endif @if($sessionsSupported ?? false)
{{ __('client.security.active_sessions') }}
@forelse($sessions ?? [] as $session) @empty @endforelse
{{ __('client.security.device_ip') }} {{ __('client.security.last_activity') }} {{ __('client.security.action') }}
{{ $session->ip_address }}
{{ $session->user_agent ? Str::limit($session->user_agent, 60) : '-' }}
{{ $session->last_activity ? \Carbon\Carbon::createFromTimestamp($session->last_activity)->diffForHumans() : '-' }} @if($session->id !== session()->getId())
@csrf
@else {{ __('client.security.current') }} @endif
{{ __('client.security.no_sessions') }}
@endif
{{ __('client.security.login_history') }}
@forelse($logins ?? [] as $login) @empty @endforelse
{{ __('client.security.login_when') }} {{ __('client.security.device_ip') }} {{ __('client.security.login_result') }}
{{ $login->created_at?->format(date_fmt().' H:i') }}
{{ $login->ip_address ?: '-' }}
{{ \App\Services\LoginRecorder::describe($login->user_agent) }}@if($login->method === 'google') ยท {{ __('client.security.via_google') }}@endif
@if($login->successful) {{ __('client.security.login_ok') }} @else {{ __('client.security.login_failed') }} @endif
{{ __('client.security.no_logins') }}
{{ __('client.security.login_history_hint') }}@if(\App\Services\LoginRecorder::mailEnabled()) {{ __('client.security.login_history_mail') }}@endif
@if($ownsAccount ?? false)
{{ __('client.security.your_data') }}

{{ __('client.security.your_data_desc') }}

@csrf
@endif @endsection