Skip to content

Commit

Permalink
Fix config secret key generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ronangr1 committed Apr 9, 2024
1 parent 519e51f commit 671b4df
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 51 deletions.
10 changes: 1 addition & 9 deletions Block/Adminhtml/System/Config/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,11 @@ protected function getButtonHtml()
*/
protected function getJs(AbstractElement $element): string
{
$url = $this->getUrl(Config::XML_PATH_HOODOOR_SECRET_KEY->value);
return '
<script>
require(["jquery", "domReady!"], function($) {
$("#generate_secret_key").click(function() {
$.ajax({
url: "'. $url .'",
type: "get",
dataType: "json",
success: function (data) {
$("#' . $element->getHtmlId() . '").val(data.secret_key);
}
});
$("#' . $element->getHtmlId() . '").val(window.crypto.randomUUID());
})
})
</script>
Expand Down
41 changes: 0 additions & 41 deletions Controller/Adminhtml/System/Config/SecretKey.php

This file was deleted.

2 changes: 1 addition & 1 deletion view/adminhtml/templates/admin/login.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* @var \Magento\Framework\View\Element\AbstractBlock $block
* @var \Opengento\Hoodoor\ViewModel\Adminhtml\Admin\Login $viewModel
* @var \Opengento\Hoodoor\ViewModel\Request\Login $viewModel
* @var \Magento\Framework\Escaper $escaper
*/

Expand Down

0 comments on commit 671b4df

Please sign in to comment.