40 lines
1.1 KiB
PHP
40 lines
1.1 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);
|
|
}
|
|
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(string $action, array $formDatas = []): UserEntity
|
|
{
|
|
foreach ($this->fields as $field) {
|
|
$formDatas[] = $this->request->getVar($field);
|
|
}
|
|
return $this->getService()->login($this->getService()->checkUser($formDatas));
|
|
}
|
|
}
|