@extends('layouts.dashboard') @section('title', __('Security')) @section('page_title', __('Account Security')) @section('content') @include('partials.how-it-works', ['key' => 'security.index']) @if($forced)
{{ __('Your administrator requires two-factor authentication for admin accounts. Set it up below to regain access to the rest of the panel.') }}
@endif @if($justEnabledCodes)
{{ __('Your recovery codes') }}

{{ __('Each code can be used once if you lose access to your authenticator app. Store them somewhere safe — they will not be shown again.') }}

@foreach($justEnabledCodes as $c)
{{ $c }}
@endforeach
@endif
{{-- 2FA --}}
{{ __('Two-factor authentication') }} {{ $user->hasTwoFactor() ? __('Enabled') : __('Off') }}
@if($user->hasTwoFactor())

{{ __('Signing in requires your password and a code from your authenticator app. Enabled :date.', ['date' => $user->two_factor_confirmed_at->format('M d, Y')]) }}

{{ trans_choice(':count recovery code left|:count recovery codes left', count($user->two_factor_recovery_codes ?? []), ['count' => count($user->two_factor_recovery_codes ?? [])]) }}

@elseif($pending)
{!! $qr !!}
{{ __("Can't scan? Enter this key:") }}
{{ chunk_split($pending, 4, ' ') }}
  1. {{ __('Install Google Authenticator, Authy, 1Password or Microsoft Authenticator.') }}
  2. {{ __('Scan the QR code (or type the key).') }}
  3. {{ __('Enter the 6-digit code shown in the app.') }}
@csrf
@error('code')
{{ $message }}
@enderror
@csrf
@else

{{ __('Add a second layer of protection: after your password, you will be asked for a 6-digit code from an authenticator app on your phone.') }}

@csrf
@endif
{{-- Login history --}}
{{ __('Recent sign-ins') }}
@forelse($logins as $l) @empty @endforelse
{{ __('When') }}{{ __('Device') }}{{ __('IP address') }}
{{ optional($l->logged_in_at)->format('M d, Y H:i') }} ({{ optional($l->logged_in_at)->diffForHumans() }}){{ $l->device ? __($l->device) : '—' }}{{ $l->ip_address }}
{{ __('No sign-ins recorded yet.') }}
{{-- Known devices --}}
{{ __('Known devices') }}
@csrf
@forelse($devices ?? [] as $d) @empty @endforelse
{{ __('Device') }}{{ __('Last seen') }}{{ __('IP address') }}
{{ __($d->device_label) }}{{ optional($d->last_seen_at)->format('M d, Y H:i') }} ({{ optional($d->last_seen_at)->diffForHumans() }}){{ $d->ip_address }}
{{ __('No devices recorded yet — they appear here on your next sign-in.') }}
{{-- Changing the password lives here, and only here, because this is the one screen that can ask for the current one first. --}}
{{ __('Password') }}
@csrf

{{ __('Use a long, unique password. You will stay signed in on this device; every other session is signed out.') }}

@error('current_password')
{{ $message }}
@enderror
@error('password')
{{ $message }}
@enderror
{{-- GDPR --}}
{{ __('Your data') }}

{{ __('Download a copy of everything stored about you — profile, enrollments, progress, orders, certificates, notes and activity — as a JSON file.') }}

@csrf
{{ __('Delete account') }}

{{ __('Permanently anonymises your personal data and closes the account. Purchases remain in the accounting records as required by law, but are no longer linked to you.') }}

{{-- Modals --}} @endsection