<?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();
        }
        return $this->_service;
    }

    public function getSNSButton(): string
    {
        return "";
    }
    //로그인처리
    protected function login_process(array $formDatas): UserEntity
    {
        return $this->getService()->login($formDatas);
    }
}
