mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
Fetch the template from the alias before generating the signature
This commit is contained in:
parent
56fc6f4b49
commit
9cebfec4c8
1 changed files with 4 additions and 4 deletions
|
|
@ -134,10 +134,10 @@ class SEOManager
|
|||
}
|
||||
|
||||
/** Configure or use Flipp. */
|
||||
public function flipp(string $template, string|array $data = null): string|static
|
||||
public function flipp(string $alias, string|array $data = null): string|static
|
||||
{
|
||||
if (is_string($data)) {
|
||||
$this->meta("flipp.templates.$template", $data);
|
||||
$this->meta("flipp.templates.$alias", $data);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -151,9 +151,9 @@ class SEOManager
|
|||
|
||||
$query = base64_encode(json_encode($data));
|
||||
|
||||
$signature = hash_hmac('sha256', $template . $query, config('services.flipp.key'));
|
||||
$template = $this->meta("flipp.templates.$alias");
|
||||
|
||||
$template = $this->meta("flipp.templates.$template");
|
||||
$signature = hash_hmac('sha256', $template . $query, config('services.flipp.key'));
|
||||
|
||||
return $this->set('image', "https://s.useflipp.com/{$template}.png?s={$signature}&v={$query}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue