dbms/app/Controllers/Auth/LocalController.php
2025-05-06 10:26:18 +09:00

42 lines
1.2 KiB
PHP

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