

<?php $__env->startSection('title', 'Iki Adimli Dogrulama'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <div class="row mb-4">
        <div class="col-12">
            <h2 class="mb-1"><i class="bi bi-shield-lock me-2"></i>Iki Adimli Dogrulama</h2>
            <p class="text-muted">Google Authenticator ile 2FA ayarlari</p>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-8">
            <div class="card border-0 shadow-sm">
                <div class="card-body">
                    <?php if(session('status')): ?>
                        <div class="alert alert-success"><?php echo e(session('status')); ?></div>
                    <?php endif; ?>
                    <?php if($errors->any()): ?>
                        <div class="alert alert-danger"><?php echo e($errors->first()); ?></div>
                    <?php endif; ?>

                    <?php if(!$user->twofa_enabled): ?>
                        <div class="mb-3">
                            <div class="fw-semibold mb-2">Durum: Kapali</div>
                            <p class="text-muted">Google Authenticator uygulamasina asagidaki bilgileri girin.</p>
                        </div>
                        <div class="mb-3 text-center">
                            <img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=<?php echo e(urlencode($otpAuthUrl)); ?>" alt="2FA QR" />
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Secret</label>
                            <div class="p-2 bg-light border rounded"><?php echo e($user->twofa_secret); ?></div>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">OTP Auth URI</label>
                            <div class="p-2 bg-light border rounded" style="word-break: break-all;"><?php echo e($otpAuthUrl); ?></div>
                        </div>

                        <form method="POST" action="<?php echo e(route('finance.2fa.enable')); ?>" class="mt-3">
                            <?php echo csrf_field(); ?>
                            <div class="mb-3">
                                <label class="form-label">6 haneli kod</label>
                                <input type="text" name="code" class="form-control" required placeholder="123456">
                            </div>
                            <button type="submit" class="btn btn-primary">Etkinlestir</button>
                        </form>
                    <?php else: ?>
                        <div class="mb-3">
                            <div class="fw-semibold">Durum: Acik</div>
                            <p class="text-muted mb-0">2FA etkin. Kapatmak icin kod girin.</p>
                        </div>

                        <form method="POST" action="<?php echo e(route('finance.2fa.disable')); ?>" class="mt-3">
                            <?php echo csrf_field(); ?>
                            <div class="mb-3">
                                <label class="form-label">6 haneli kod</label>
                                <input type="text" name="code" class="form-control" required placeholder="123456">
                            </div>
                            <button type="submit" class="btn btn-outline-danger">Devre Disi Birak</button>
                        </form>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('finance.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/cmummhol/public_html/zoom/resources/views/finance/auth/twofa.blade.php ENDPATH**/ ?>