Skip to content

Commit

Permalink
config lock added in all package
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Oct 20, 2023
1 parent c63a954 commit 0bfe871
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 35 deletions.
8 changes: 8 additions & 0 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
// config for fintech/auth
return [

/*
|--------------------------------------------------------------------------
| Enable Module APIs
|--------------------------------------------------------------------------
| this setting enable the api will be available or not
*/
'enabled' => true,

/*
|--------------------------------------------------------------------------
| Auth Group Root Prefix
Expand Down
72 changes: 37 additions & 35 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Fintech\Auth\Http\Controllers\PasswordResetController;
use Fintech\Auth\Http\Controllers\RegisteredUserController;
use Fintech\Auth\Http\Controllers\VerifyEmailController;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Route;

/*
Expand All @@ -17,51 +18,52 @@
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
if (Config::get('fintech.auth.enabled')) {
Route::prefix('auth')->name('auth.')->group(function () {
Route::post('/register', [RegisteredUserController::class, 'store'])
->middleware('guest')
->name('register');

Route::prefix('auth')->name('auth.')->group(function () {
Route::post('/register', [RegisteredUserController::class, 'store'])
->middleware('guest')
->name('register');
Route::post('/login', [AuthenticatedSessionController::class, 'store'])
->middleware('guest')
->name('login');

Route::post('/login', [AuthenticatedSessionController::class, 'store'])
->middleware('guest')
->name('login');
if (config('fintech.auth.self_password_reset')) {

if (config('fintech.auth.self_password_reset')) {
Route::post('/forgot-password', [PasswordResetController::class, 'store'])
->middleware('guest')
->name('forgot-password');

Route::post('/forgot-password', [PasswordResetController::class, 'store'])
->middleware('guest')
->name('forgot-password');

Route::post('/reset-password', [PasswordResetController::class, 'update'])
->middleware('guest')
->name('reset-password');
}
Route::post('/reset-password', [PasswordResetController::class, 'update'])
->middleware('guest')
->name('reset-password');
}

Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class)
->middleware(['auth', 'signed', 'throttle:6,1'])
->name('verification.verify');
Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class)
->middleware(['auth', 'signed', 'throttle:6,1'])
->name('verification.verify');

Route::post('/email/verification-notification', [EmailVerificationController::class, 'store'])
->middleware(['auth', 'throttle:6,1'])
->name('verification.send');
Route::post('/email/verification-notification', [EmailVerificationController::class, 'store'])
->middleware(['auth', 'throttle:6,1'])
->name('verification.send');

Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
->middleware(config('fintech.auth.middleware'))
->name('logout');
Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
->middleware(config('fintech.auth.middleware'))
->name('logout');

Route::middleware(config('fintech.auth.middleware'))->group(function () {
Route::apiResource('users', \Fintech\Auth\Http\Controllers\UserController::class);
Route::middleware(config('fintech.auth.middleware'))->group(function () {
Route::apiResource('users', \Fintech\Auth\Http\Controllers\UserController::class);

Route::apiResource('roles', \Fintech\Auth\Http\Controllers\RoleController::class);
Route::post('roles/{role}/restore', [\Fintech\Auth\Http\Controllers\RoleController::class, 'restore'])->name('roles.restore');
Route::apiResource('roles', \Fintech\Auth\Http\Controllers\RoleController::class);
Route::post('roles/{role}/restore', [\Fintech\Auth\Http\Controllers\RoleController::class, 'restore'])->name('roles.restore');

Route::apiResource('permissions', \Fintech\Auth\Http\Controllers\PermissionController::class);
Route::post('permissions/{permission}/restore', [\Fintech\Auth\Http\Controllers\PermissionController::class, 'restore'])->name('permissions.restore');
Route::apiResource('permissions', \Fintech\Auth\Http\Controllers\PermissionController::class);
Route::post('permissions/{permission}/restore', [\Fintech\Auth\Http\Controllers\PermissionController::class, 'restore'])->name('permissions.restore');

// Route::apiResource('teams', \Fintech\Auth\Http\Controllers\TeamController::class);
// Route::post('teams/{team}/restore', [\Fintech\Auth\Http\Controllers\TeamController::class, 'restore'])->name('teams.restore');
// Route::apiResource('teams', \Fintech\Auth\Http\Controllers\TeamController::class);
// Route::post('teams/{team}/restore', [\Fintech\Auth\Http\Controllers\TeamController::class, 'restore'])->name('teams.restore');

Route::apiResource('settings', \Fintech\Auth\Http\Controllers\SettingController::class)->only(['index', 'store']);
Route::apiResource('settings', \Fintech\Auth\Http\Controllers\SettingController::class)->only(['index', 'store']);
});
});
});
}

0 comments on commit 0bfe871

Please sign in to comment.