Skip to content

Commit

Permalink
Merge pull request #329 from kbrabrand/auth-events
Browse files Browse the repository at this point in the history
Add event hooks to accessToken and authenticate event listeners
  • Loading branch information
rexxars committed May 30, 2015
2 parents 9489c7f + 3218f97 commit f2533de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion library/Imbo/EventListener/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public static function getSubscribedEvents() {
$callbacks = array();
$events = array(
'user.get', 'images.get', 'image.get', 'metadata.get',
'user.head', 'images.head', 'image.head', 'metadata.head'
'user.head', 'images.head', 'image.head', 'metadata.head',
'auth.accesstoken'
);

foreach ($events as $event) {
Expand Down
17 changes: 9 additions & 8 deletions library/Imbo/EventListener/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ class Authenticate implements ListenerInterface {
public static function getSubscribedEvents() {
$callbacks = array();
$events = array(
'images.post', // When adding images
'image.delete', // When deleting images
'metadata.put', // When adding/replacing metadata
'metadata.post', // When adding/patching metadata
'metadata.delete', // When deleting metadata
'shorturls.post', // Add a short URL
'shorturls.delete', // Delete a collection of short URLs
'shorturl.delete', // Delete a single short URL
'images.post', // When adding images
'image.delete', // When deleting images
'metadata.put', // When adding/replacing metadata
'metadata.post', // When adding/patching metadata
'metadata.delete', // When deleting metadata
'shorturls.post', // Add a short URL
'shorturls.delete', // Delete a collection of short URLs
'shorturl.delete', // Delete a single short URL
'auth.authenticate', // Authenticate event
);

foreach ($events as $event) {
Expand Down

0 comments on commit f2533de

Please sign in to comment.