34 lines
1013 B
PHP
34 lines
1013 B
PHP
<?php
|
|
|
|
namespace App\Controllers\Auth;
|
|
|
|
use App\Entities\UserEntity;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class GoogleController extends AuthController
|
|
{
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
if ($this->service === null) {
|
|
$this->service = service('googleauth');
|
|
}
|
|
}
|
|
public function login_form_process(): void
|
|
{
|
|
//구글 로그인 BUTTON용
|
|
$this->addViewDatas('SNSButton', anchor($this->service->socket->createAuthUrl(), ICONS['GOOGLE'] . 'Google 로그인', ["class" => "btn-google"]));
|
|
}
|
|
//로그인처리
|
|
protected function login_process(): UserEntity
|
|
{
|
|
return $this->service->login($this->request->getPost());
|
|
}
|
|
protected function logout_process(): void
|
|
{
|
|
$this->service->logout();
|
|
}
|
|
}
|