Skip to content

Commit

Permalink
Merge pull request #5 from Progi1984/fixConfigurePage
Browse files Browse the repository at this point in the history
Fixed wording & configuration page
  • Loading branch information
Progi1984 authored Apr 25, 2023
2 parents 6d3c653 + b2eae4b commit 8df23d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>keycloak_connector_demo</name>
<displayName><![CDATA[Keycloak OAuth2 connector demo]]></displayName>
<version><![CDATA[1.0.1]]></version>
<version><![CDATA[1.0.2]]></version>
<description><![CDATA[Demo module of how to use Keycloak as OAuth2 Authentication Server for the new API]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[]]></tab>
Expand Down
2 changes: 1 addition & 1 deletion keycloak_connector_demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct($name = null, Context $context = null)
{
$this->name = 'keycloak_connector_demo';
$this->displayName = 'Keycloak OAuth2 connector demo';
$this->version = '1.0.1';
$this->version = '1.0.2';
$this->author = 'PrestaShop';
$this->description = 'Demo module of how to use Keycloak as OAuth2 Authentication Server for the new API';
$this->need_instance = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function indexAction(Request $request): Response
if ($configurationForm->isSubmitted() && $configurationForm->isValid()) {
$errors = $configurationDataHandler->save((array) $configurationForm->getData());
if (empty($errors)) {
$this->addFlash('success', $this->trans('Successful update.', 'Admin.Notifications.Success'));
$this->addFlash('success', $this->trans('Successful update', 'Admin.Notifications.Success'));

return $this->redirectToRoute('keycloak_connector_configuration');
}
Expand Down
9 changes: 6 additions & 3 deletions src/Form/ConfigurationDataConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ public function __construct(
*/
public function getConfiguration(): array
{
$endpoint = $this->encryption->decrypt($this->configuration->get(static::REALM_ENDPOINT));
if (!is_string($endpoint)) {
throw new RuntimeException('Unable to decrypt realm endpoint configuration');
$endpoint = (string) $this->configuration->get(static::REALM_ENDPOINT);
if (!empty($endpoint)) {
$endpoint = $this->encryption->decrypt($endpoint);
if (!is_string($endpoint)) {
throw new RuntimeException('Unable to decrypt realm endpoint configuration');
}
}

return [
Expand Down

0 comments on commit 8df23d6

Please sign in to comment.