Files
exchange-2.0/app/Classes/Modules/Accounts/ControllersLogic/RefreshAuthenticationTokenLogic.php
T
omair saleh 05401f6bbc large commit
2021-03-11 13:06:40 +08:00

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));
}
}