-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Labels
Description
- Laravel Version: 5.7.19
- PHP Version: 7.2
- Database Driver & Version: MariaDB latest
Description: Generated signed URL's fails to 403 (Invalid Signature)
Steps To Reproduce:
- Login to your Laravel application with the default authentication from Laravel
- Generate a signed url and set your route to use the "signed" middleware...
- Go to the generated url while logged in, and you'll see the 403 error.
- Logout from your Laravel application and try again the generated signed url, now it should work.
Doubts:
Is this how is supposed to work the signed routes? what if i want to generate a temporary signed url to share some content for a limited time to my users? should they logout in order to access to this url each time? or i'm i missing something?
---------UPDATE--------
Code:
web.php
Route::get('/report/{user}/{client}', function ($user, $client) {
return ("The user is: $user and the client is: $client");
})->name('temp.report')->middleware('signed');
genTempUrlController.php
public function tempURL()
{
$tempURL= Url::temporarySignedRoute('temp.report', now('America/Costa_Rica')->addMinutes(25), [
'user' => 1,
'client' => 1
]);
return $tempURL;
}
The URL is generated and shows something like this:
If the user is logged in the result is a 403 Forbidden (Invalid Signature) page, otherwise if the user is logged out, then the link works fine.