mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Accounts\ControllersLogic;
|
|
|
|
use App\Classes\Modules\Accounts\Processors\AuthenticationProcessor;
|
|
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class AuthenticateUserLogic extends AbstractControllerLogic
|
|
{
|
|
|
|
protected function notification():array {
|
|
return [
|
|
'title' => 'Authentication',
|
|
'message' => 'You have successfully logged in to your account'
|
|
];
|
|
}
|
|
|
|
/** @var AuthenticationProcessor */
|
|
private $authenticationProcessor;
|
|
|
|
|
|
/**
|
|
* AuthenticateUserLogic constructor.
|
|
* @param AuthenticationProcessor $authenticationProcessor
|
|
*/
|
|
public function __construct(AuthenticationProcessor $authenticationProcessor)
|
|
{
|
|
$this->authenticationProcessor = $authenticationProcessor;
|
|
}
|
|
|
|
/**
|
|
* @param Request $request
|
|
* @return JsonResponse
|
|
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
|
* @throws \App\Classes\Exceptions\AccessUnauthorisedException
|
|
* @throws \App\Classes\Exceptions\InternalServerErrorException
|
|
* @throws \App\Classes\Exceptions\RequestValidationException
|
|
*/
|
|
protected function logic(Request $request): JsonResponse {
|
|
|
|
return $this->response($this->authenticationProcessor->execute($request));
|
|
}
|
|
|
|
} |