mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
47 lines
1.4 KiB
PHP
47 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Accounts\ControllersLogic;
|
|
|
|
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
use App\Classes\Modules\Accounts\Processors\RefreshAuthenticationTokenProcessor;
|
|
use App\Models\User;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class RefreshAuthenticationTokenLogic extends AbstractControllerLogic
|
|
{
|
|
|
|
protected function notification():array {
|
|
return [
|
|
'title' => 'Refresh Authentication',
|
|
'message' => 'You have successfully your account authentication'
|
|
];
|
|
}
|
|
|
|
/** @var RefreshAuthenticationTokenProcessor */
|
|
private $refreshAuthenticationTokenProcessor;
|
|
|
|
/**
|
|
* RefreshAuthenticationTokenLogic constructor.
|
|
* @param RefreshAuthenticationTokenProcessor $refreshAuthenticationTokenProcessor
|
|
*/
|
|
public function __construct(RefreshAuthenticationTokenProcessor $refreshAuthenticationTokenProcessor)
|
|
{
|
|
$this->refreshAuthenticationTokenProcessor = $refreshAuthenticationTokenProcessor;
|
|
}
|
|
|
|
/**
|
|
* @param Request $request
|
|
* @return JsonResponse
|
|
* @throws \App\Classes\Exceptions\InternalServerErrorException
|
|
*/
|
|
protected function logic(Request $request): JsonResponse {
|
|
|
|
/** @var User $user */
|
|
$user = Auth()->user();
|
|
|
|
return $this->response($this->refreshAuthenticationTokenProcessor->execute($user));
|
|
|
|
}
|
|
|
|
} |