public function getToken()
{
$Provider = $this->getProvider();
if (is_null($this->Token)) {
$UserID = Gdn::authenticator()->getIdentity();
$UserAuthenticationData = Gdn::sql()->select('uat.*')->from('UserAuthenticationToken uat')->join('UserAuthentication ua', 'ua.ForeignUserKey = uat.ForeignUserKey')->where('ua.UserID', $UserID)->where('ua.ProviderKey', $Provider['AuthenticationKey'])->limit(1)->get();
if ($UserAuthenticationData->numRows()) {
$this->Token = $UserAuthenticationData->firstRow(DATASET_TYPE_ARRAY);
} else {
return false;
}
}
return $this->Token;
}