<?php

Route::middleware(['aud'])->group(function () {
    Route::prefix('aud')->group(function () {

        // Create AUD accounts
        Route::post('import', 'AuthStack\Driver\AUDGeneric\App\Controllers\AUDImport@import')
            ->name('aud.import');
    });
});

Route::middleware(['web'])->group(function () {
    Route::prefix('aud')->group(function () {

        // Reset password routes
        Route::get('password/reset/{token}', 'AuthStack\Driver\AUDGeneric\App\Controllers\AUDPassword@passwordResetWithToken')
            ->name('aud.password.token');
    });
});

Route::prefix('aud')->group(function () {

    // Reset password routes
    Route::get('forgot-password', 'AuthStack\Driver\AUDGeneric\App\Controllers\AUDPassword@passwordInit')
        ->name('aud.password.init');

    Route::post('forgot-password', 'AuthStack\Driver\AUDGeneric\App\Controllers\AUDPassword@passwordReset')
        ->name('aud.password.forgot');

    Route::post('password/update', 'AuthStack\Driver\AUDGeneric\App\Controllers\AUDPassword@updatePassword')
        ->name('aud.password.update');

    Route::post('sp/password/reset', 'AuthStack\Driver\AUDGeneric\App\Controllers\AUDPassword@passwordResetFromSP')
        ->name('aud.sp.password.reset');
});