Add controllers and packages for security keys
This commit is contained in:
parent
f8ec8b4d5a
commit
06f692e649
29 changed files with 2398 additions and 383 deletions
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Services\Users\SecurityKeys;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Webauthn\PublicKeyCredentialCreationOptions;
|
||||
use Pterodactyl\Repositories\SecurityKeys\WebauthnServerRepository;
|
||||
|
||||
class CreatePublicKeyCredentialService
|
||||
{
|
||||
protected WebauthnServerRepository $webauthnServerRepository;
|
||||
|
||||
public function __construct(WebauthnServerRepository $webauthnServerRepository)
|
||||
{
|
||||
$this->webauthnServerRepository = $webauthnServerRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Webauthn\Exception\InvalidDataException
|
||||
*/
|
||||
public function handle(User $user): PublicKeyCredentialCreationOptions
|
||||
{
|
||||
return $this->webauthnServerRepository->getPublicKeyCredentialCreationOptions($user);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue