Skip to content

Instantly share code, notes, and snippets.

@gms8994
Created January 15, 2013 14:37
Show Gist options
  • Save gms8994/4539109 to your computer and use it in GitHub Desktop.
Save gms8994/4539109 to your computer and use it in GitHub Desktop.
$app->hook('slim.before', function() use ($app){
$authenticated = $app->request()->headers('X-API-KEY') == API_KEY;
if(! $authenticated) {
throw new ApiException('Authentication failed');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment