mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 02:15:51 +00:00
fix(terminal): apply authorization middleware to terminal bootstrap routes
Apply the existing `can.access.terminal` middleware to `POST /terminal/auth` and `POST /terminal/auth/ips` routes, consistent with the `GET /terminal` route. Adds regression tests covering unauthenticated, member, admin, and owner roles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1bd957073b
commit
847166a3f8
2 files changed
+120
-2
No files matched your search
+2
-2
@@ -164,7 +164,7 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
||||
}
|
||||
|
||||
return response()->json(['authenticated' => false], 401);
|
||||
})->name('terminal.auth');
|
||||
})->name('terminal.auth')->middleware('can.access.terminal');
|
||||
|
||||
Route::post('/terminal/auth/ips', function () {
|
||||
if (auth()->check()) {
|
||||
@@ -189,7 +189,7 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
||||
}
|
||||
|
||||
return response()->json(['ipAddresses' => []], 401);
|
||||
})->name('terminal.auth.ips');
|
||||
})->name('terminal.auth.ips')->middleware('can.access.terminal');
|
||||
|
||||
Route::prefix('invitations')->group(function () {
|
||||
Route::get('/{uuid}', [Controller::class, 'acceptInvitation'])->name('team.invitation.accept');
|
||||
|
||||
Reference in new issue
Block a user