@extends('layouts.main_dashboard.app') @section('title', __('dashboard.Two-Factor Authentication')) @section('page_heading', __('dashboard.Two-Factor Authentication')) @section('breadcrumb') @php $homeRoute = match (auth()->user()?->type) { 'teacher' => route('teacher.home'), 'staff' => route('admin.home'), default => route('admin.home'), }; @endphp @endsection @section('content')
@if (session('success'))
{{ session('success') }}
@endif

{{ __('dashboard.Two-Factor Authentication') }}

@if ($enabled) {{ __('dashboard.Enabled') }} @else {{ __('dashboard.Disabled') }} @endif
@unless ($enabled) {{-- Setup: show QR code --}}

{{ __('dashboard.Scan the QR code below with your authenticator app (Google Authenticator, Authy, etc.), then enter the 6-digit code to activate.') }}

{!! $qrCode !!}

{{ __('dashboard.Manual setup key') }}

{{ $user->two_factor_secret }}
@csrf
@error('code')
{{ $message }}
@enderror
@else {{-- Disable: confirm with code --}}

{{ __('dashboard.Two-factor authentication is currently active on your account. Enter a code from your authenticator app to disable it.') }}

@csrf @method('DELETE')
@error('code')
{{ $message }}
@enderror
@endunless
@endsection