function farm_api_menu_alter in farmOS 7
Implements hook_menu_alter().
File
- modules/
farm/ farm_api/ farm_api.module, line 56 - Farm API module.
Code
function farm_api_menu_alter(&$items) {
// Make OAuth2 token endpoints available at both oauth2/* and oauth/*.
// See https://www.drupal.org/project/farm/issues/3172818
$oauth_aliases = array(
'oauth2/authorize' => 'oauth/authorize',
'oauth2/revoke' => 'oauth/revoke',
'oauth2/token' => 'oauth/token',
);
foreach ($oauth_aliases as $source => $alias) {
if (!empty($items[$source])) {
$items[$alias] = $items[$source];
}
}
}