Skip to content

Package breaks signed out/temporary signed route url generation #14

@mnazmi23

Description

@mnazmi23

Hi,

I had to uninstall this lovely package. I came from Mcmara localization package and this package just works out of the box, including the URL translation.

I have been using it for the past weeks, adding translations and stuff, until the testing part for using the signed route url. I spent 2 days troubleshooting this issue, until I tried uninstalling this package, and my app works again(for the url creation part).

Step to reproduce, try using the email resend feature included by laravel. I got the error
call_user_func() expects parameter 1 to be a valid callback, no array or string given

Upon inspection, the error came from Illuminate/Routing/URLGenerator class, in this function,

` public function hasCorrectSignature(Request $request, $absolute = true)
{
$url = $absolute ? $request->url() : '/'.$request->path();

    $original = rtrim($url.'?'.Arr::query(
        Arr::except($request->query(), 'signature')
    ), '?');

    $signature = hash_hmac('sha256', $original, call_user_func($this->keyResolver));

    return hash_equals($signature, (string) $request->query('signature', ''));
}` 

This part ==>> call_user_func($this->keyResolver)) has the value null in it. When I tried commenting some of the lines in here, the email resend feature works again.

Turns out your package has URLGenerator file and extending the LaravelUrlGenerator in it. I think there is some thing missing in your code.

This is the log,
call_user_func() expects parameter 1 to be a valid callback, no array or string given {"exception":"[object] (ErrorException(code: 0): call_user_func() expects parameter 1 to be a valid callback, no array or string given at C:\\project\\app\\portal-x\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\UrlGenerator.php:337)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions