Thursday, April 12, 2018

Laravel Middleware: Role + signed URL - development

Laravel Middleware: Role + signed URL

In my Routes I have videos/{id} I want to use a Signed URL, which works fine, but I also want to access the page if logged as admin, but I don’t know how to use both together. as admin.

when I access the page

middleware('signed')
middleware('role:superadministrator|administrator')

How can I mix both?

middleware('signed', 'role:superadministrator|administrator')

it returns invalid signature

Route::get('/videos/{id}', 'VideoController@show', function (Request $request, $id, $user, $company) {
  if (! $request->hasValidSignature()) {
    abort(401);
  }
})->name('video')->middleware('signed','role:superadministrator|administrator');



from Laravel Questions and Answers https://laravelquestions.com/laravel/laravel-middleware-role-signed-url/
via Lzo Media

No comments:

Post a Comment