<?php

// use App\Http\Controllers\Auth\ConfirmablePasswordController;
// use App\Http\Controllers\Auth\EmailVerificationNotificationController;
// use App\Http\Controllers\Auth\EmailVerificationPromptController;
// use App\Http\Controllers\Auth\NewPasswordController;
// use App\Http\Controllers\Auth\PasswordController;
// use App\Http\Controllers\Auth\PasswordResetLinkController;
// use App\Http\Controllers\Auth\RegisteredUserController;
// use App\Http\Controllers\Auth\VerifyEmailController;



use Illuminate\Support\Facades\Route;



use App\Http\Controllers\Auth\AuthenticatedSessionController;
use App\Http\Controllers\UserAuth\ForgotPasswordController;
use App\Http\Controllers\UserAuth\NewPasswordController;
use App\Http\Controllers\UserAuth\RegisterController;
use App\Http\Controllers\UserAuth\EmailVerificationController;
use App\Http\Controllers\UserAuth\Google2FaController;
use App\Http\Controllers\UserAuth\ChangeEmailVerificationController;

Route::get('login.py', [AuthenticatedSessionController::class, 'create'])
->name('login');

Route::get('login.py', [AuthenticatedSessionController::class, 'create'])
->name('login.py');

Route::post('login', [AuthenticatedSessionController::class, 'store'])->name('login');

Route::get('/Servlet/forgotPassword.py', [ForgotPasswordController::class, 'create'])
->name('password.request');

Route::post('/Servlet/resentPassword.py', [ForgotPasswordController::class, 'store'])
->name('password.email');

Route::get('/Servlet/PasswordReset.py/{token}', [NewPasswordController::class, 'create'])
->name('password.reset');

Route::post('/Servlet/PasswordSave.py', [NewPasswordController::class, 'store'])
->name('password.store');



Route::controller(RegisterController::class)->group(function(){
    Route::get('/Servlet/UserReg.py' , 'index')->name('register.index');
    Route::post('/Servlet/UserSave.py' , 'store')->name('register.store');
    
});

Route::controller(EmailVerificationController::class)->group(function(){
    Route::get('/Servlet/VerifyEmail.py', 'VerifyEmail')->name('verify.email');
    Route::post('/Servlet/Verify.py', 'Verify')->name('verify.email.verfication');
});


Route::controller(ChangeEmailVerificationController::class)->group(function(){
    Route::get('/Servlet/changeEmail.py', 'index')->name('change.email.verification');
    Route::post('/Servlet/ChangeEmailSave.py', 'store')->name('store.changed.email.verification');

});


Route::controller(Google2FaController::class)->group(function(){
    Route::get('/Servlet/complete-google2fa.py', 'CompleteGoogle2FaScan')->name('registeration.complete.googel2fa');
    Route::get('/Servlet/secretKey.py', 'SecretKeyPage')->name('registeration.google2fa.secretkey.page');
    Route::post('/Servlet/SecretKeyCheck.py', 'CheckSecretKey')->name('registeration.google2fa.check.secretkey');
    Route::get('/Servlet/skip-googlefa.py', 'skipGoogle2FA')->name('registeration.skip.google2fa');
});

Route::middleware('auth')->group(function () {

    Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
        ->name('logout');
});
