mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 23:03:45 +02:00
Obliterate JWT from codebase
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Traits\Helpers;
|
||||
|
||||
use Lcobucci\JWT\Signer;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait ProvidesJWTServices
|
||||
{
|
||||
/**
|
||||
* Get the signing key to use when creating JWTs.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getJWTSigningKey(): string
|
||||
{
|
||||
$key = config()->get('jwt.key', '');
|
||||
if (Str::startsWith($key, 'base64:')) {
|
||||
$key = base64_decode(substr($key, 7));
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the signing algo to use for JWT.
|
||||
*
|
||||
* @return \Lcobucci\JWT\Signer
|
||||
*/
|
||||
public function getJWTSigner(): Signer
|
||||
{
|
||||
$class = config()->get('jwt.signer');
|
||||
|
||||
return new $class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user