Skip to content

Instantly share code, notes, and snippets.

@ProdigyView
Created January 6, 2019 22:11
Show Gist options
  • Save ProdigyView/88033d93d22d1c8462ff7182feabd08b to your computer and use it in GitHub Desktop.
Save ProdigyView/88033d93d22d1c8462ff7182feabd08b to your computer and use it in GitHub Desktop.
<?php
function validateToken(string $token, string $privileges = '', array $tokens, int $current_time) : bool {
if(!isset($tokens[$token])) {
return false;
}
if(hasExpired($token, $tokens, $current_time)) {
return false;
}
return checkPrivileges($token,$privileges, $tokens);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment