Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed URL in notification not working with localized route #739

Open
YannikFirre opened this issue Aug 12, 2020 · 7 comments
Open

Signed URL in notification not working with localized route #739

YannikFirre opened this issue Aug 12, 2020 · 7 comments

Comments

@YannikFirre
Copy link

YannikFirre commented Aug 12, 2020

Describe the bug
When i use signed url on localized url in notification, it's doesn't work.

To Reproduce

Route::group([
    'prefix' => \Mcamara\LaravelLocalization\Facades\LaravelLocalization::setLocale(),
    'middleware' => ['localeSessionRedirect'],
], static function () {
Route::get('test', function() {
  return "test";
})
    ->middleware('signed')
    ->name('test');
});

URL::signedRoute('test'); works in view but not in notification when called in toArray method.

Expected behavior
The toRoute method called in signedURL return the uri without the locale.

More info:

  • Laravel 7.25
  • Laravel-localization 1.5.0

Thanks for any help :D

@juliancc
Copy link

juliancc commented Apr 1, 2021

Having the same issue. @YannikFirre did you find a solution?

@YannikFirre
Copy link
Author

Hello,

No, finally, my route did not need to be localized.

Sorry :/

@MattiaMarchiorato
Copy link

Same problem for us, if we generate a signed route and we visit it without the language code is working, if we add the language code to url we receive a 401 error.

@yordivd
Copy link

yordivd commented Dec 24, 2021

Same issue here. If it's a queued notification that contains a signedRoute, the route in the email is generated is without the locale en therefore invalid as the server auto redirects it to the currentLocale.

@kofeinstyle
Copy link

I have the same problem with the verify route and queued mail.
One solution it`s custom logic for UrlGenerator::temporarySignedRoute

@wilfredot
Copy link

I fixed it puting LaravelLocalization::setLocale() before to use URL::signedRoute

@hatem-elsheref
Copy link

hatem-elsheref commented Nov 1, 2023

just add the path of route to ignored array in laravellocalization.php config file

'urlsIgnored' => ['/skipped', '/backend/email/verify/*'],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants