<?php

use App\Domains\UserManagement\Controllers\EmailVerificationController;
use App\Domains\UserManagement\Controllers\LoginController;
use App\Domains\UserManagement\Controllers\LogOutController;
use App\Domains\UserManagement\Controllers\ProfileController;
use App\Domains\UserManagement\Controllers\RegistrationController;
use App\Domains\UserManagement\Controllers\ResetPasswordController;
use App\Middleware\IdentifyTenant;
use Illuminate\Support\Facades\Route;

Route::middleware(IdentifyTenant::class)->group(function () {
    Route::get('/register', [RegistrationController::class, 'loginForm']);
    Route::get('/register/verifyEmail', [EmailVerificationController::class, 'verifyEmailForm']);

    Route::get('/reset-password', [ResetPasswordController::class, 'resetPasswordForm']);

    route::get('/logout', LogOutController::class);
    route::post('/login', [LoginController::class, 'doLogin']);
    route::get('/login', [LoginController::class, 'loginForm']);

    Route::middleware(['auth'])->group(function () {
        Route::post('/logout', [LogoutController::class, 'logout']);
        Route::get('/profile', ProfileController::class);


    });
});



