public function lookupNonce($TokenKey, $Nonce = null)
{
$NonceData = Gdn::database()->sql()->select('uan.*')->from('UserAuthenticationNonce uan')->where('uan.Token', $TokenKey)->get()->firstRow(DATASET_TYPE_ARRAY);
if ($NonceData && (is_null($Nonce) || $NonceData['Nonce'] == $Nonce)) {
return $NonceData['Nonce'];
}
return false;
}