Skip to content

Commit

Permalink
Renane callback uri field to redirect uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 27, 2025
1 parent 8d9f49d commit 89de835
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/plugins/CoreServer/resources/locales/en_US/core_server.po
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ msgstr "Access Token Grant Type"
msgid "field.Oauth2Servers.url"
msgstr "Server URL"

msgid "field.Oauth2Servers.callback_endpoint"
msgstr "Callback URI"
msgid "field.Oauth2Servers.redirect_uri"
msgstr "Redirect URI"

msgid "field.Oauth2Servers.scope"
msgstr "Scopes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,16 @@ class Oauth2ServersController extends StandardPluginController
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.2.0
*/

public function beforeRender(EventInterface $event)
{
// Generate the callback URL
// Generate the Redirect URI

if ($this->getRequest()->getParam('action') === 'edit') {
$id = $this->getRequest()->getParam('pass')[0] ?? null; // Assuming $id comes from passed arguments
$this->set('vv_callback_endpoint', $this->Oauth2Servers->redirectUri($id));
$this->set('vv_redirect_uri', $this->Oauth2Servers->redirectUri($id));
}

return parent::beforeRender($event);
Expand Down
7 changes: 3 additions & 4 deletions app/plugins/CoreServer/templates/Oauth2Servers/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ if($vv_action !== 'edit') {
return;
}

// Render the callback endpoint

// Render the Redirect URI
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'callback_endpoint',
'fieldName' => 'redirect_uri',
'fieldOptions' => [
'readOnly' => true,
'default' => $vv_callback_endpoint
'default' => $vv_redirect_uri
]
]]);

Expand Down

0 comments on commit 89de835

Please sign in to comment.