allow upload routes for impersonation (#526)
This commit is contained in:
parent
4af1e05958
commit
80663b5285
|
|
@ -58,6 +58,8 @@ class ImpersonationMiddleware
|
||||||
|
|
||||||
'user.current',
|
'user.current',
|
||||||
'local.temp',
|
'local.temp',
|
||||||
|
'vapor.signed-storage-url',
|
||||||
|
'upload-file'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -78,6 +80,7 @@ class ImpersonationMiddleware
|
||||||
|
|
||||||
// Check that route is allowed
|
// Check that route is allowed
|
||||||
$routeName = $request->route()->getName();
|
$routeName = $request->route()->getName();
|
||||||
|
ray($routeName);
|
||||||
if (!in_array($routeName, self::ALLOWED_ROUTES)) {
|
if (!in_array($routeName, self::ALLOWED_ROUTES)) {
|
||||||
return response([
|
return response([
|
||||||
'message' => 'Unauthorized when impersonating',
|
'message' => 'Unauthorized when impersonating',
|
||||||
|
|
|
||||||
|
|
@ -330,11 +330,11 @@ Route::post(
|
||||||
Route::post(
|
Route::post(
|
||||||
'/vapor/signed-storage-url',
|
'/vapor/signed-storage-url',
|
||||||
[\App\Http\Controllers\Content\SignedStorageUrlController::class, 'store']
|
[\App\Http\Controllers\Content\SignedStorageUrlController::class, 'store']
|
||||||
)->middleware([]);
|
)->name('vapor.signed-storage-url');
|
||||||
Route::post(
|
Route::post(
|
||||||
'/upload-file',
|
'/upload-file',
|
||||||
[\App\Http\Controllers\Content\FileUploadController::class, 'upload']
|
[\App\Http\Controllers\Content\FileUploadController::class, 'upload']
|
||||||
)->middleware([]);
|
)->name('upload-file');
|
||||||
|
|
||||||
Route::get('local/temp/{path}', function (Request $request, string $path) {
|
Route::get('local/temp/{path}', function (Request $request, string $path) {
|
||||||
if (!$request->hasValidSignature()) {
|
if (!$request->hasValidSignature()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue