_mySocket = $mySocket; parent::__construct(); } final public function getClassName(): string { return "AuthGoogle"; } final public function getClassPath(): string { return $this->getClassName(); } public function getModelClass(): string { return Model::class; } public function getEntityClass(): string { return Entity::class; } public function getMySocket(string $access_code): mixed { if ($this->_mySocket === null) { throw new \Exception("Socket 방식이 지정되지 않았습니다."); } $this->_mySocket->setToken($this->_access_code); return $this->_mySocket; } public function checkUser(string $access_code): Entity { try { // Google 서비스 설정 $userSNS_entity = $this->getMySocket($access_code)->getUserSNSEntity(); // local db 사용와의 연결 확인 $this->getModel()->where($this->getModel()::PK, $userSNS_entity->getParent()); $entity = $this->getModel()->getEntity(); if ($entity === null) { throw new PageNotFoundException("회원[{$userSNS_entity->getTitle()}]님은 아직 로컬사용자 연결이 이루어지지 않았습니다."); } return $entity; } catch (\Google_Service_Exception $e) { log_message('error', '구글 서비스 예외: ' . $e->getMessage()); throw new PageNotFoundException("구글 로그인 중 오류가 발생했습니다. 다시 시도해 주세요."); } catch (\Exception $e) { log_message('error', $e->getMessage()); throw new PageNotFoundException("관리자에게 문의하시기 바랍니다.\n{$e->getMessage()}"); } } }