40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Auth;
|
|
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
use CodeIgniter\HTTP\RedirectResponse;
|
|
|
|
use App\Helpers\AuthHelper as Helper;
|
|
use App\Services\Auth\LocalService as Service;
|
|
use App\Entities\UserEntity as Entity;
|
|
|
|
class LocalController extends AuthController
|
|
{
|
|
private ?Service $_service = null;
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
|
|
$this->title = lang("{$this->getService()->getClassPath()}.title");;
|
|
$this->helper = new Helper($this->getService());
|
|
}
|
|
final public function getService(): Service
|
|
{
|
|
if (!$this->_service) {
|
|
$this->_service = new Service($this->request);
|
|
}
|
|
return $this->_service;
|
|
}
|
|
|
|
//로그인처리
|
|
protected function login_process(): Entity
|
|
{
|
|
$this->init(__FUNCTION__);
|
|
$this->formDatas = $this->doValidate($this->action, $this->fields);
|
|
return $this->getService()->login($this->getService()->checkUser($this->formDatas));
|
|
}
|
|
}
|