Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
leog committed Nov 16, 2020
1 parent 0e4f2a3 commit 25aa185
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
),
],
'parameters' => array(
'auth0_management_api_token' => ''
'auth0_management_api_token' => '',
'auth0_domain_url' => ''
)
];
4 changes: 4 additions & 0 deletions EventListener/ConfigSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public function onConfigSave(ConfigEvent $event)
$values['auth0_config']['auth0_management_api_token'] = htmlspecialchars($values['auth0_config']['auth0_management_api_token']);
}

if (!empty($values['auth0_config']['auth0_domain_url'])) {
$values['auth0_config']['auth0_domain_url'] = htmlspecialchars($values['auth0_config']['auth0_domain_url']);
}

// Set updated values
$event->setConfig($values);
}
Expand Down
6 changes: 6 additions & 0 deletions EventListener/EmailSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
use Mautic\EmailBundle\Event\EmailBuilderEvent;
use Mautic\EmailBundle\Event\EmailSendEvent;

use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Class EmailSubscriber
*/
Expand Down
12 changes: 12 additions & 0 deletions Form/Type/Auth0Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
)
)
);

$builder->add(
'auth0_domain_url',
'text',
array(
'label' => 'plugin.auth0.config.auth0_domain_url',
'data' => $options['data']['auth0_domain_url'],
'attr' => array(
'tooltip' => 'plugin.auth0.config.auth0_domain_url_tooltip',
)
)
);
}

/**
Expand Down
7 changes: 6 additions & 1 deletion Translations/en_US/messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ plugin.auth0.password_reset_ticket_url.token = "Password Reset Ticket URL"
mautic.config.tab.auth0_config = "Auth0 Settings"

plugin.auth0.config.auth0_management_api_token = "Auth0 Management API Token"
plugin.auth0.config.auth0_management_api_token_tooltip = "Please read the official docs on how to get it."
plugin.auth0.config.auth0_management_api_token_tooltip = "Please read the official docs on how to get it."

plugin.auth0.config.auth0_domain_url = "Auth0 Domain URL"
plugin.auth0.config.auth0_domain_url_tooltip = "Your Auth0 domain URL (e.g. acme.auth0.com)"

plugin.auth0.config.auth0_management_api_token.error = "Error generating Password Reset Ticket URL"

0 comments on commit 25aa185

Please sign in to comment.