Add captcha tokens management.
This commit is contained in:
@@ -11,6 +11,9 @@ use App\Captcha\Images\Head;
|
||||
use App\Captcha\Images\ImageManager;
|
||||
use App\Captcha\Images\Lines;
|
||||
use App\Services\Api\V1\CaptchaService;
|
||||
use App\Services\CaptchaToken\CaptchaTokenHandler;
|
||||
use App\Services\GenerateTokenCommand\GenerateTokenUlidCommand;
|
||||
use App\Services\GenerateTokenCommand\GenerateTokenUuidCommand;
|
||||
use App\Services\Search\CreateSearchInstanceCommand;
|
||||
use App\Services\Search\Search;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
@@ -43,6 +46,13 @@ final class AppServiceProvider extends ServiceProvider
|
||||
imageBody: $app->make(ImageBody::class)
|
||||
);
|
||||
});
|
||||
|
||||
$this->app->bind(CaptchaTokenHandler::class, function (Application $app) {
|
||||
return new CaptchaTokenHandler(
|
||||
generatePublicTokenCommand: $app->make(GenerateTokenUlidCommand::class),
|
||||
generatePrivateTokenCommand: $app->make(GenerateTokenUuidCommand::class)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
// use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
final class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The model to policy mappings for the application.
|
||||
@@ -13,7 +13,9 @@ class AuthServiceProvider extends ServiceProvider
|
||||
* @var array<class-string, class-string>
|
||||
*/
|
||||
protected $policies = [
|
||||
\App\Models\Role::class => \App\Policies\RolePolicy::class,
|
||||
\App\Models\Role::class => \App\Policies\RolePolicy::class,
|
||||
\App\Models\User::class => \App\Policies\UserPolicy::class,
|
||||
\App\Models\CaptchaToken::class => \App\Policies\CaptchaTokenPolicy::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user