<?php
 abstract class vB_Api_ExternalLogin_OAuth2Client extends vB_Api_ExternalLogin { use vB_Trait_NoSerialize; protected function __construct() { } public function getTokenRedirect() { return ['url' => $this->library->getTokenRedirect()]; } public function confirmToken($code, $checkstate) { $this->library->confirmToken($code, $checkstate); return ['success' => true]; } public function verifyAuthAndLogin($url = '', $userid = null) { return $this->library->verifyAuthAndLogin($url, $userid); } public function canLinkCurrentUser() { $this->library->getExternalUseridForLinking(); return ['success' => true]; } public function linkCurrentUser() { $this->library->linkCurrentUserWithApp(); return ['success' => true]; } public function unlinkCurrentUser() { $this->library->unlinkCurrentUserFromApp(); return ['success' => true]; } public function getRegistrationData() { return $this->library->getRegistrationData(); } public function forgetRegistrationData() { return $this->library->deleteSessionAuthRecord(); } public function getState() { $userAuth = $this->library->getUserAuthRecord(); $enabled = $this->library->getEnabled(); return [ 'enabled' => $enabled['enabled'], 'register_enabled' => $enabled['register_enabled'], 'external_userid' => $userAuth['external_userid'] ?? '', ]; } } 